0

On Windows, there's the shutdown cmd line, but is there a windows command line command to call a "standby"?

What I'd really like is to call something like standby -force to force a system to enter standby even when a pesky app is trying to prevent it.

bobobobo
  • 769
  • 6
  • 14
  • 26

3 Answers3

2

PSshutdown, part of the free PSTools suite from the Sysinternals team at Microsoft, can do this. Shutdown.exe on my XP machine will not - you have not told us what version of Windows you're asking about, and I don't know if shutdown.exe has that option on Vista or different Server versions.

mfinni
  • 35,711
  • 3
  • 50
  • 86
2

rundll32.exe powrprof.dll,SetSuspendState

The action will differ depending on whether or not you have Hibernation enabled.

Documentation on SetSuspendState:
https://docs.microsoft.com/en-us/windows/desktop/api/powrprof/nf-powrprof-setsuspendstate

sinping
  • 2,055
  • 14
  • 12
0

In Windows Vista and 7 you can use the /h switch of the shutdown command to hibernate the computer and /f to force the command: shutdown /h /f.

Rob D.
  • 233
  • 1
  • 3
  • 10