|
-
Aug 22nd, 2006, 01:31 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] shutdown, restart, hibernate etc.
hi,
wts the commands for shutdown, log off, restart, hibernate, stand by etc.???
-
Aug 22nd, 2006, 01:45 AM
#2
Addicted Member
Re: [2005] shutdown, restart, hibernate etc.
 Originally Posted by JXDOS
hi,
wts the commands for shutdown, log off, restart, hibernate, stand by etc.???
check this:
http://www.vbforums.com/showthread.p...light=shutdown
Or you can use this:
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")
Hope this helps...
Regards,
=======================================
If I helped you, Kindly Rate my post. Thanks
-----------
PHENOM 
-
Aug 22nd, 2006, 01:47 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] shutdown, restart, hibernate etc.
thats the dos command isn't it?
and there is no dos command 4 standby and hibernate...
Last edited by JXDOS; Aug 22nd, 2006 at 01:57 AM.
-
Aug 22nd, 2006, 01:56 AM
#4
Addicted Member
Re: [2005] shutdown, restart, hibernate etc.
 Originally Posted by JXDOS
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:
http://www.vbforums.com/showthread.p...light=shutdown
VB Code:
Process.Start("shutdown.exe", "-I -f -t 00") 'Log Off
Regards,
=======================================
If I helped you, Kindly Rate my post. Thanks
-----------
PHENOM 
-
Aug 22nd, 2006, 01:59 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] shutdown, restart, hibernate etc.
i've seen that thread b4
PS
WindowsController.ExitWindows(RestartOptions.Reboot, True)
wts windows controller?? its not recognised...
-
Aug 22nd, 2006, 02:12 AM
#6
Re: [2005] shutdown, restart, hibernate etc.
Look at post #4 in that thread.
-
Aug 22nd, 2006, 02:45 AM
#7
Thread Starter
Hyperactive Member
Re: [2005] shutdown, restart, hibernate etc.
-
Jul 15th, 2007, 12:53 PM
#8
Re: [RESOLVED] [2005] shutdown, restart, hibernate etc.
Anyone find the code to put the machine in STANDBY mode?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jul 15th, 2007, 01:55 PM
#9
Re: [RESOLVED] [2005] shutdown, restart, hibernate etc.
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
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|