1.

Solve : how to assign OS ver to a variable??

Answer»

I NEED to identify the OS version (W2K or WXP) as a variable in a DOS Bat file. example.......based on which OS run prog1.exe or prog2.exe

can't find the command to assign the contents of VER into a variable.

thanxThis code NEEDS to be in a batch file:

Code: [Select]
for /f "tokens=1-4*" %%a in ('ver') do (if %%c==XP (prog1) else (prog2))


HOPE this helps.

Gee! FOR's are so POPULAR we'll have to BRING back our two for one sale.There should be a variable %OS%.

if "os"=="XP" (prog1) else (prog2)

So you can save one FOR loop. ;-)


Please correct me if I am wrong.
uli



Discussion

No Comment Found