2.列举进程 @echo for each ps in getobject _ >ps.vbs @echo ("winmgmts:\\.\root\cimv2:win32_process").instances_ >>ps.vbs @echo wscript.echo ps.handle^vbtab^ps.name^vbtab^ps.executablepath:next >>ps.vbs
用法:cscript ps.vbs
3.终止进程 @echo for each ps in getobject _ >pskill.vbs @echo ("winmgmts:\\.\root\cimv2:win32_process").instances_ >>pskill.vbs @echo if ps.handle=wscript.arguments(0) then wscript.echo ps.terminate:end if:next >>pskill.vbs
用法:cscript pskill.vbs pid
4.重启系统 @echo for each os in getobject _ >reboot.vbs @echo ("winmgmts:!\\.\root\cimv2:win32_operatingsystem").instances_ >>reboot.vbs @echo os.win32shutdown(2):next >>reboot.vbs