Click here to Skip to main content
15,922,529 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fixed: New Problem Pin
leppie7-Jun-03 22:56
leppie7-Jun-03 22:56 
GeneralADO and C# (simple question) Pin
albean6-Jun-03 10:50
albean6-Jun-03 10:50 
GeneralRe: ADO and C# (simple question) Pin
Kant6-Jun-03 12:16
Kant6-Jun-03 12:16 
GeneralRe: ADO and C# (simple question) Pin
James T. Johnson6-Jun-03 13:11
James T. Johnson6-Jun-03 13:11 
GeneralRe: ADO and C# (simple question) Pin
Daniel Turini6-Jun-03 21:46
Daniel Turini6-Jun-03 21:46 
GeneralRe: ADO and C# (simple question) Pin
Kannan Kalyanaraman8-Jun-03 0:10
Kannan Kalyanaraman8-Jun-03 0:10 
GeneralRe: ADO and C# (simple question) Pin
Daniel Turini9-Jun-03 6:52
Daniel Turini9-Jun-03 6:52 
GeneralRe: ADO and C# (simple question) Pin
jspano7-Jun-03 17:12
jspano7-Jun-03 17:12 
Generalform event hierarchy Pin
albean6-Jun-03 8:55
albean6-Jun-03 8:55 
Generalapplication's path Pin
rabidDog6-Jun-03 5:35
rabidDog6-Jun-03 5:35 
GeneralRe: application's path Pin
Kannan Kalyanaraman6-Jun-03 5:44
Kannan Kalyanaraman6-Jun-03 5:44 
GeneralRe: application's path Pin
gek_at6-Jun-03 7:55
gek_at6-Jun-03 7:55 
GeneralRe: application's path Pin
dynamic7-Jun-03 13:07
dynamic7-Jun-03 13:07 
GeneralCause validation of Textbox control when a menu item is clicked Pin
DionChen6-Jun-03 5:20
DionChen6-Jun-03 5:20 
GeneralRe: Cause validation of Textbox control when a menu item is clicked Pin
leppie6-Jun-03 7:19
leppie6-Jun-03 7:19 
Generalauto-documentation Pin
Le centriste6-Jun-03 4:52
Le centriste6-Jun-03 4:52 
GeneralRe: auto-documentation Pin
Daniel Turini6-Jun-03 5:27
Daniel Turini6-Jun-03 5:27 
GeneralRe: auto-documentation Pin
Kannan Kalyanaraman6-Jun-03 5:29
Kannan Kalyanaraman6-Jun-03 5:29 
GeneralTx for both answers Pin
Le centriste6-Jun-03 5:42
Le centriste6-Jun-03 5:42 
Generalxlat MFC to C# (Thread question) Pin
albean6-Jun-03 3:04
albean6-Jun-03 3:04 
GeneralTurn off computer Pin
yarns5-Jun-03 20:49
yarns5-Jun-03 20:49 
GeneralRe: Turn off computer Pin
J. Dunlap5-Jun-03 20:57
J. Dunlap5-Jun-03 20:57 
GeneralRe: Turn off computer Pin
Member 128221435-Jun-03 21:18
Member 128221435-Jun-03 21:18 
GeneralRe: Turn off computer Pin
Nathan Blomquist6-Jun-03 2:33
Nathan Blomquist6-Jun-03 2:33 
GeneralRe: Turn off computer Pin
Bo Hunter6-Jun-03 5:43
Bo Hunter6-Jun-03 5:43 
You can also do it with WMI Script

Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery _
("Select * from Win32_OperatingSystem")
For Each ObjOperatingSystem In colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next

Save this as .vbs file and run it.
you can also reboot with this script.

'Reboot computer script.
strComputer = "."

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



Bo Hunter

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.