Tuesday, December 9, 2008

Shutting Down the Local Computer

Shuts down the local computer

Set colOperatingSystems = GetObject_
    ("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
 
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Win32Shutdown(1)
Next

This is a VB Script, this can be used by saving the file in .vbs file