how to shutdown/restart/standby windows

tahu191

Well-known member
Joined
Oct 27, 2005
Messages
48
Location
USA
Programming Experience
Beginner
how do i make windows either shutdown, restart or go into standby? with vb
 
windows 2000 and xp both have this nifty file known as Shutdown.exe that's located in the windows\system folder, simply run that process from your vb app:
VB.NET:
'Log off:
System.Diagnostics.Process.Start("Shutdown.exe", "-l")

'Restart:
System.Diagnostics.Process.Start("Shutdown.exe", "-r")

'Shutdown:
System.Diagnostics.Process.Start("Shutdown.exe", "-s")

there are other arguements that shutdown.exe can take, i'll let you do the research on those to further customize how ya want it to behave
 
Shutdown without using Shutdown.exe

Hi,

here is a sample i have found on the net about shutting down the pc without the help of Shutdown.exe !!

Regards
MJCM
 

Attachments

  • Shutdown (NET).zip
    55.6 KB · Views: 53
MJCM said:
Hi,

here is a sample i have found on the net about shutting down the pc without the help of Shutdown.exe !!

Regards
MJCM

that's because it makes use of the api calls, and it's nice that it's all in a module for convenience too
 
Back
Top