
CODE: [Copy to clipboard]去掉了:"Total Physical Memory (kb): " &strComputer = "localhost"
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
For Each wbemObject In wbemObjectSet
WScript.Echo wbemObject.TotalPhysicalMemory
Next
CODE: [Copy to clipboard]如果命令多:for /f %%i in ('"cscript //nologo 1.vbs"') do if %%i LSS 800000 执行命令
CODE: [Copy to clipboard]纯VBS:for /f %%i in ('"cscript //nologo 1.vbs"') do if %%i GEQ 800000 exit
执行命令
CODE: [Copy to clipboard][ Last edited by zh159 on 2007-2-19 at 07:42 PM ]strComputer = "localhost"
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
Set WSHShell = WScript.CreateObject("WScript.Shell")
For Each wbemObject In wbemObjectSet
if wbemObject.TotalPhysicalMemory < 800000 then WshShell.Run "执行命令"
Next
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |