Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Telling the computer to shutdown, restart, standby, and hibernate

Telling the computer to shutdown, restart, standby, and hibernate

Scheduled Pinned Locked Moved Visual Basic
javatutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jacobjordan
    wrote on last edited by
    #1

    Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).

    L L 2 Replies Last reply
    0
    • J jacobjordan

      Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, do you remember those good old days where /? gave help information on DOS commands? It still works for shutdown.exe, so most of your needs have an easy solution based on Process.Start(). The restart-with-delay does not seem to be in the list of options tho. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Voting for dummies? No thanks. X|


      1 Reply Last reply
      0
      • J jacobjordan

        Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Article on calling shutdown.exe[^]. Instead of doing that, just make a call to ExitWindowsEx[^].

        J 1 Reply Last reply
        0
        • L Lost User

          Article on calling shutdown.exe[^]. Instead of doing that, just make a call to ExitWindowsEx[^].

          J Offline
          J Offline
          jacobjordan
          wrote on last edited by
          #4

          Thanks, and that helps a lot, but neither of those methods have a function to hibernate or put the comp into standby. Is there any way i can do that?

          L 1 Reply Last reply
          0
          • J jacobjordan

            Thanks, and that helps a lot, but neither of those methods have a function to hibernate or put the comp into standby. Is there any way i can do that?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            SetSuspendState[^] API, or Application.SetSuspendState[^] in .NET.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups