How can I turn off the monitor (i.e., "put it to sleep") via command line at the push of a button (or any other shortcut not requiring additional software)?

Anonymous
2010-03-14T22:31:58+00:00

Hello,

  I don't like it when, after a pause working on my PC, the screen turns itself off as set up per "Power Options" on the control panel. That's why I set the threshold fairly high.

  Still, when I know I won't be needing the computer for a while, I want to save power and wish the sleep mode could be activated immediately. Turning the display off is not an option, since it has an integrated USB-hub -- turning it off completely would disconnect any connected device. Usually though the computer still runs and might need the connected resources.

  Ideally, by pushing a button (or starting a program or something), the display would immediately go into sleep mode.

  On systems before Vista and 7, IIRC, executing a command along the lines of:

rundll32.exe user32.dll,SendMessage (HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);

  would do the trick. The dll would execute the command to put the monitor to sleep. One could create a shortcut or even integrate the command into a batch file, but unfortunately that doesn't seem to work on Vista or 7.

  Does anybody have an idea on how to do this on Windows 7?

  I would very much try to avoid having to install any additional software to help me out. (There are quite some small applications around, even free ones, that promise to do just that, but I would like to avoid them if possible. And I cannot believe that something this basic that could be done on XP cannot be done anymore on 7!)

  Thank you for your help,

NicApicella

Windows for home | Previous Windows versions | Accessibility

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2012-10-01T05:28:04+00:00

Hello,

Sleep is one thing and Switching Off the Display is quite another.

I have found a way to switch off the Display in case you do not have a hardware switch or a Hotkey as in my Dell Inspiron Laptop (Windows 7).

Create a batch file with the following script:

echo off

C:\Windows\System32\powercfg.exe -Change -monitor-timeout-dc 1

C:\Windows\System32\powercfg.exe -Change -monitor-timeout-ac 1

START /MIN /WAIT C:\Windows\System32\scrnsave.scr -s

C:\Windows\System32\powercfg.exe -Change -monitor-timeout-dc m1

C:\Windows\System32\powercfg.exe -Change -monitor-timeout-ac m2

replace m1 and m2 with the idle time for switching off your display defined in control panel.

Control Panel > Power Options > whichever "Active" Power Plan > Change Plan Settings > Turn off the display setting (minutes).

For example in my laptop m1 = 10 and m2 = 30.

Now create a shortcut to this batch file and optionally assign a Hotkey and an Icon.

Explanation of the script:

The first two commands sets the Display Off idle time for the minimum possible setting of 1 Minute for both AC and DC (Battery) power. The third command put the system in Blank Screen Saver mode "instantly", and /WAIT for the screen saver application to terminate. After 1 minute of idle time the Monitor will switch off power completely.

Once the screen saver /WAIT is terminated by the wakeup event of a mouse movement or keystroke, the last two lines of code will revert the Display idle time-out to the original defined settings in Control Panel. This to ensure that after wake-up, the display does not turn-off every 1 minute of idle time out.

Regards,

Sushovon Sinha

Was this answer helpful?

50+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
@CmdrKeene 90,631 Reputation points Volunteer Moderator
2010-03-15T21:03:08+00:00

You can activate sleep mode quickly from the start menu.  In the Start menu, right-click the shutdown choice and use the Properties option to change the default to be Sleep.  Then your sleep is always 1-click away.





If this was helpful, please vote by clicking the green triangle. If it solves the issue, click Propose as Answer. Thanks!

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2010-03-15T13:10:03+00:00

Hello NicApicella,

I don't know if this will help but i did happen across this page here

http://social.technet.microsoft.com/Forums/en-US/itprovistasp/thread/2d179f82-9b0a-4b58-a0e8-d699b92e91ac

thier using  rundll32 /d powrprof.dll,SetSuspendState this does seem to turn the monitor off

or

http://www.howtogeek.com/howto/windows-vista/change-the-windows-vista-power-buttons-to-shut-down/

Was this answer helpful?

0 comments No comments

43 additional answers

Sort by: Newest
  1. Anonymous
    2014-03-18T13:54:36+00:00

    I have lenovo U400 ultrabook. The keyboard does not have the key ( or combination of keys) that I can use to turn off the display. I want the system and network to be on for my applications to run always continuously without disconnection  and turn off only display whenever I want. Every now and then, turning on the network takes lot of time and sync up in my applications (apart from email sync, other data streaming applns etc) take time. Whenever I want to wake it up, I will need it instantaneously with network on and application upto the second. For that purpose sleep will not work as the network goes off during sleep. Sleep has its own use and turning off the display has its own use and my current quest is for manual turning off the display. Currently even if I set the time out in power management via control panel, it is not working. I do not have the descreet monior. I know they come with the power on/off hardware switch. I am talking about laptop screen itself.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-03-18T13:09:41+00:00

    Dear Janard,

    Network will be disconnected while in Sleep mode. On resume, you will have to click the network icon on the taskbar and click the connect button next to the wifi.

    If you have a discrete monitor as in a desktop, you can use the power switch on the monitor to turn it off.

    Regards,

    Sushovon Sinha

    Was this answer helpful?

    0 comments No comments