Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
@echo off
echo
:start
cls
echo.if "%3" == "" goto first
if "%3" == "wp" goto second
if "%3" == "pp" goto second:second
echo Select Option
echo 1 -- ac -- xxx
echo 2 -- pg -- yyy
echo 3 -- Exit
echo.
CHOICE /N /C:123 ENTER OPTION [1-3] %4
echo.
if errorlevel == 3 goto end
if errorlevel == 2 goto second_pg
if errorlevel == 1 goto second_acbeeb
echo.
echo.
goto end:second_ac
java -jar \\aaa\bbb\ccc\ddd\eee.jar %2 %1
goto end:second_pg
java -jar \\aaa\bbb\ccc\ddd\eee.jar %2 %3 %1
goto end:end
@echo on%1, %2 and %3 are the parameters I am passing from my command prompt and am able to assign the same to a string in my Java code. But %4 is the option which I am selecting in my command prompt and am not able to catch the same in my Java code. Please tell me how do I assign %4 to a string, like for instance
1. When I select %4 in my command prompt as ENTER OPTION [1-3] 1, then I should assign ac to %4
2. When I select %4 in my command prompt as ENTER OPTION [1-3] 2, then I should assign pg to %4Could anyone please tell me how do I do this.
sony_tj

You can't assign variables like %4 by way of set. What one might do is something like set the variable to something like T4.
eg
set T1=%1
set T2=%2
set T3=%3
set T4=%4It will then work with these variables.
I normally use variables beginning in Y for temporary variables, since it is elsewise out of use.
You then get java or something to read the variable from the CMD environment.
The dream you dream alone is only a dream,
The dream we dream together is reality.

![]() |
Logon Loop
|
redeploy sp4 group policy
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |