Board logo

标题: 我这脚本在2000和2003下执行怎么不一样 [打印本页]

作者: iaspec     时间: 2006-8-7 16:30    标题: 我这脚本在2000和2003下执行怎么不一样

各位,我在执行一无人值守安装的项目,需要使用批处理来处理安装系统后的一些处理工作,这个批处理是通过cmdlines.txt的执行命令去运行批处理,那现在主要涉及到对系统物理内存的判断来修改boot.ini的参数值,我使用VBSCRIPT来获得系统的物理内存值(3742668版主曾建议使用WMIC来做,但我主要是判断2000系统和2003系统,该命令并不适用)
那我现在使用的VBS+批处理在2000系统在系统安装时能正确做出判断,但是2003却不行,后面的循环它根本不做
VB脚本:aa.vbs
strComputer = "localhost"
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")

For Each wbemObject In wbemObjectSet
  WScript.Echo "Total Physical Memory (kb): " & wbemObject.TotalPhysicalMemory
Next
批处理脚本:aaa.bat
for /f "tokens=5" %%i in ('"cscript //nologo .\aa.vbs"') do set sysmem1=%%i
if %sysmem1% LSS 3145132 goto aaa
for /f "delims=" %%l in (\boot.ini) do (
    echo.%%l | find/i "/fastdetect">nul && echo %%l /pae||echo %%l
)>>\b1.txt
findstr /V "C:" \b1.txt>\TMP.TXT
attrib -s -h \boot.ini
move /y \TMP.TXT \boot.ini
del /Q \b1.txt
attrib +s +h \boot.ini
exit

:aaa
findstr /V "C:" \boot.ini>\TMP.TXT
attrib -s -h \boot.ini
move /y \TMP.TXT \boot.ini
attrib +s +h \boot.ini

WIN2003却不行
使用它,使用echo %systme1% > abc.txt,它返回给我的信息是echo is off
而在2000,它会返回变量值
请问各位高手,2003需要怎样设置,变量才生效 ,谢谢