Computer Shutdown program

Dannyyoung

New member
Joined
Jul 5, 2004
Messages
3
Programming Experience
10+
How do I cause a win2000 computer to do a shutdown programatically?

Danny
 

Mykre

Active member
Joined
Jun 14, 2004
Messages
28
Location
Australia
Programming Experience
3-5
You would have to use the API or WMI to do the task, Here is a VBscript that can do the task in WMI.

VB.NET:
strComputer = "atl-dc-01"
Set objWMIService = GetObject("winmgmts:" _	& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _		strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _	("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems	
ObjOperatingSystem.Reboot()
Next
 
Top Bottom