'0:Log Off
'4:Forced Log Off (0 + 4)
'1:Shutdown ( 使用するなら、Power Off )
'5:Forced Shutdown (1 + 4) ( 使用するなら、Power Off )
'2:Reboot
'6:Forced Reboot (2 + 4)
'8:Power Off
'12:Forced Power Off (8 + 4)
Set colOperatingSystems = _
GetObject("winmgmts:{(Shutdown)}").ExecQuery( _
"Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(Wscript.Arguments(0))
Next
|