Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#16
Post
by ShadowThief » 23 Feb 2015 04:28
You're confusing %G% with %%G. They are totally different variables.
Also, the echo before the set means that the %myvariable% variable doesn't actually get set. You can either remove the echo from that line or just call %%G by itself.
Like this:
Code: Select all
@echo off
set CLASSPATH=decoder.jar
FOR /F "delims=" %%G in ('java decode.decoder "dGhpc0lzTXlQVw=="') DO
{
echo %%G
}
Or this:
Code: Select all
@echo off
setlocal enabledelayedexpansion
set CLASSPATH=decoder.jar
FOR /F "delims=" %%G in ('java decode.decoder "dGhpc0lzTXlQVw=="') DO
{
set myvariable=%%G
echo !myvariable!
}
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#18
Post
by foxidrive » 23 Feb 2015 05:54
There were still flaws with the parentheses used and the placement of the opening parenthesis.
Code: Select all
@echo off
set CLASSPATH=decoder.jar
FOR /F "delims=" %%G in ('java decode.decoder "dGhpc0lzTXlQVw=="') DO (
echo %%G
)
pause
Test this: