I have this weird thing going on that I can't figure out. In my batch script I'm running a java cli program that connects to a server which I have no problems doing. But in order to run the program I have the user type in their server credentials. If the login fails, I get an "Error" string as a response from the java program which I then ask the user if they want to try again.
After checking the response for "Error", my problem occurs when asking the user if they want to try again. For whatever reason nothing get captured/stored in my tryAgain variable.
for /f %%i in ('java -jar cli-launcher.jar -a https://127.0.0.1:8000 -u admin -p admin -s someOtherScript.txt) do set response=%%i
::Something about this IF statement is causing an issue
IF NOT %response::=%==Error (echo "No Error"
) else (SET /p tryAgain=Try Again:
echo "%tryAgain%"
)
EDIT:
Looks like my problem has to with my checking of the response string. When I pull out the tryAgain user capture, it works fine. Can anyone see what I'm doing wrong?
for /f %%i in ('java -jar cli-launcher.jar -a https://127.0.0.1:8000 -u admin -p admin -s someOtherScript.txt) do set response=%%i
::This works fine
SET /p tryAgain=Try Again:
echo "%tryAgain%"