判断操作系统类别的批处理,如下
ver >> c:\a.txt
for /f "tokens=3 delims= " %%I in (c:\a.txt) do set %%I=a
if %a%==98 do command1
if %a%==me do command1
if %a%==2000 do command2
if %a%==xp do command2
if %a%==2003 do command2
################################
for /f "tokens=3 delims= " %%I in (c:\a.txt)
请问上面那个命令是如何在a.txt文件中取值的?因为我发现在98和XP下运行ver后输出内容的格式不统一,分别如下,会不会影响执行过程?
Windows 98
Microsoft Windows XP
[ Last edited by willsort on 2006-6-14 at 17:12 ]
ver >> c:\a.txt
for /f "tokens=3 delims= " %%I in (c:\a.txt) do set %%I=a
if %a%==98 do command1
if %a%==me do command1
if %a%==2000 do command2
if %a%==xp do command2
if %a%==2003 do command2
################################
for /f "tokens=3 delims= " %%I in (c:\a.txt)
请问上面那个命令是如何在a.txt文件中取值的?因为我发现在98和XP下运行ver后输出内容的格式不统一,分别如下,会不会影响执行过程?
Windows 98
Microsoft Windows XP
[ Last edited by willsort on 2006-6-14 at 17:12 ]
