hi,
wts the commands for shutdown, log off, restart, hibernate, stand by etc.???
Printable View
hi,
wts the commands for shutdown, log off, restart, hibernate, stand by etc.???
check this:Quote:
Originally Posted by JXDOS
http://www.vbforums.com/showthread.p...light=shutdown
Or you can use this:
Hope this helps...VB Code:
'-f to force app to close Process.Start("shutdown", "-s -f -t 00") 'ShutDown -s Process.Start("shutdown", "-r -f -t 00") 'Restart -r 'etc... Process.Start("shutdown", "-a")
Regards,
thats the dos command isn't it?
and there is no dos command 4 standby and hibernate...
as i told you have a look @ this thread:Quote:
Originally Posted by JXDOS
http://www.vbforums.com/showthread.p...light=shutdown
VB Code:
Process.Start("shutdown.exe", "-I -f -t 00") 'Log Off
Regards,
i've seen that thread b4
PS
WindowsController.ExitWindows(RestartOptions.Reboot, True)
wts windows controller?? its not recognised...
:rolleyes: Look at post #4 in that thread.
.. nvm
Anyone find the code to put the machine in STANDBY mode?
I realize the thread is old but I finally tracked down the answer, use SuspendState API:
http://msdn2.microsoft.com/en-us/library/aa373201.aspx (Sorry for the VB6 code).
VB Code:
Private Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Integer, ByVal fForce As Integer) As Integer Private Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, ByVal DisableWakeEvent As Boolean) As Boolean Public Sub GotoStandbyMode() 'SetSystemPowerState 1, 0 ' doesn't seem to work...? SetSuspendState False, False, False End Sub