Results 1 to 9 of 9

Thread: [RESOLVED] [2005] shutdown, restart, hibernate etc.

  1. #1

    Thread Starter
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Resolved [RESOLVED] [2005] shutdown, restart, hibernate etc.

    hi,
    wts the commands for shutdown, log off, restart, hibernate, stand by etc.???

  2. #2
    Addicted Member phenom's Avatar
    Join Date
    Apr 2006
    Location
    UAE
    Posts
    233

    Re: [2005] shutdown, restart, hibernate etc.

    Quote 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:
    1. '-f to force app to close
    2. Process.Start("shutdown", "-s -f -t 00") 'ShutDown  -s
    3. Process.Start("shutdown", "-r -f -t 00") 'Restart -r
    4. 'etc...
    5. Process.Start("shutdown", "-a")
    Hope this helps...

    Regards,
    =======================================
    If I helped you, Kindly Rate my post. Thanks
    -----------
    PHENOM

  3. #3

    Thread Starter
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    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.

  4. #4
    Addicted Member phenom's Avatar
    Join Date
    Apr 2006
    Location
    UAE
    Posts
    233

    Re: [2005] shutdown, restart, hibernate etc.

    Quote 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:
    1. Process.Start("shutdown.exe", "-I -f -t 00") 'Log Off

    Regards,
    =======================================
    If I helped you, Kindly Rate my post. Thanks
    -----------
    PHENOM

  5. #5

    Thread Starter
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: [2005] shutdown, restart, hibernate etc.

    i've seen that thread b4

    PS
    WindowsController.ExitWindows(RestartOptions.Reboot, True)
    wts windows controller?? its not recognised...

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] shutdown, restart, hibernate etc.

    Look at post #4 in that thread.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Hyperactive Member JXDOS's Avatar
    Join Date
    Aug 2006
    Location
    Mars...
    Posts
    423

    Re: [2005] shutdown, restart, hibernate etc.

    .. nvm

  8. #8
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    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.

  9. #9
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    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:
    1. Private Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Integer, ByVal fForce As Integer) As Integer
    2. Private Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, ByVal DisableWakeEvent As Boolean) As Boolean
    3.  
    4. Public Sub GotoStandbyMode()
    5.     'SetSystemPowerState 1, 0 ' doesn't seem to work...?
    6.     SetSuspendState False, False, False
    7. 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
  •  



Click Here to Expand Forum to Full Width