I know this question has been asked in all shapes and forms on here, and my syntax seems to be correct, I can't understand where I am going wrong.
When using
FOR /F "tokens=4 delims=." %%G IN ("7.1.2.12") DO ECHO This is G: %%G
in cmd.exe I get an output of 12, as expected.
If I put that number into a file version.txt for example
FOR /F "tokens=4 delims=." %%G IN (version.txt) DO ECHO This is G: %%G
I don't get any output or error, nothing!
Even when explicit about the directory
FOR /F "tokens=4 delims=." %%G IN (C:\Users\Myname\Desktop\version.txt) DO ECHO This is G: %%G
I looked into setlocal EnableDelayedExpansion
but don't think it applies in my situation (I eventually want to SET
%%G
to a variable.)
Sidenote: I am using the double % because I'm running it from a batch file.
Any ideas? Any more info needed?
`WMIC DATAFILE WHERE name="C:\\Program Files (x86)\\Company\\Application.exe" get Version>C:\Users\Myname\Desktop\UNIversion.txt`
`REM Converting the extracted file from UNICODE to ASCII:`
`CMD /A /C TYPE UNIversion.txt > ASCIIversion.txt` – Marvin Sinclair Nov 02 '16 at 08:05