How can I make my screen blank by a shortcut?

156,810

Solution 1

You can just make a shortcut to the blank screensaver and then set a keyboard shortcut via the properties window for the shortcut.

The screensaver is called scrnsave.scr, located in %SYSTEMROOT%\system32.

Solution 2

You can easily do this with NirCmd, these four options will give you a black screen each (with side effect):

  • Turn off the monitor.

    nircmd.exe monitor off
    
  • Start the default screen saver (set it to a blank one, so you can make the screen blank).

    nircmd.exe screensaver
    
  • Put your computer in 'standby' mode.

    nircmd.exe standby
    
  • Turn off your computer.

    nircmd.exe exitwin poweroff
    

Make sure that you have nircmd.exe in C:\Windows\System32 if you want to call it from anywhere.


As Dennis Williamson pointed out in his comment, you can create a hotkey like this:

nircmd.exe cmdshortcutkey "C:\Windows\Temp" "MO" "Ctrl+Shift+M" monitor off

Or a shortcut on your desktop which you can click like this:

nircmd.exe cmdshortcut "~$folder.desktop$" "Turn Monitor off" monitor off

With AutoHotkey, you can bind any of the above commands to a hotkey:

#s::Run nircmd.exe monitor off

The above hotkey WIN+S would for example turn the monitor off.

An alternative program, if you dislike scripting, could be PhaseExpress.

Solution 3

Set your screensaver to the one called "blank". Press Win-L.

Here are some examples of using AutoHotkey to turn off the monitor or start the screen saver without needing NirCmd.

Solution 4

Another option using AutoHotkey:

SendMessage 0x112, 0xF170, 2,,Program Manager

You need to install AutoHotkey (1.1.x, not sure if it works in 2.x), create a text file with .ahk extension (e.g. turn_off_screen.ahk), paste this line there using any text editor, and you can run it by double click.

Solution 5

There is a built-in function on my laptop. Just hit the Fn+F6. This toggles the black screen on my laptop, anyway: no extra command programming required.

Share:
156,810

Related videos on Youtube

barlop
Author by

barlop

Updated on September 17, 2022

Comments

  • barlop
    barlop over 1 year

    I'd like a shortcut that makes the screen go to a black screen immediately, without turning any power off, or even putting it to sleep.

    What ways can I do that?

    How more efficient the solution is to set up, the better.

    • Admin
      Admin over 10 years
      Alternatively you can create a black background fullscreen app and place a shortcut on the taskbar. Also you can set the desktop background to solid black color, hide all items on the desktop and enable taskbar auto-hiding. Then just press Win+D and voila.
  • Dennis Williamson
    Dennis Williamson about 13 years
    @barlop: You could probably do something with AutoHotkey.
  • barlop
    barlop about 13 years
    hmm, can you include how to do this automatically with a keyboard shortcut? if you're familiar with whatever software does it
  • Dennis Williamson
    Dennis Williamson about 13 years
    @barlop: From the examples nircmd.exe cmdshortcutkey "c:\temp" "Turn Monitor Off" "Ctrl+Shift+M" monitor off
  • Tamara Wijsman
    Tamara Wijsman about 13 years
    @DennisWilliamson: Oh, didn't see that. Updating answer a second time...
  • barlop
    barlop about 13 years
    @Dennis Williamson That just creates a lnk file for it. doesn't run the lnk file on a shortcut
  • barlop
    barlop about 13 years
    @TomWij That line you mentioned almost does it, but I just amended the nircmd.exe to the full path of it, then it works.
  • barlop
    barlop about 13 years
    @TomWij i'm using the #s suggestion. The command nircmd.exe cmdshortcutkey "C:\Windows\Temp" "MO" "Ctrl+Shift+M" monitor off Doesn't create a hotkey It just creates a lnk file in that temp directory called MO.lnk ctrl-shift-m doesn't turn the monitor off.
  • Tamara Wijsman
    Tamara Wijsman about 13 years
    @barlop: I added the System32 suggestion for your first comment; as for the second comment it does set the hotkey for that file to Ctrl+Shift+M, but it seems that this hotkey would only function if you have the shortcut on your background. I also got confused whether you meant a "shortcut file" or "shortcut keys" in your question. But well, glad one of the suggestions worked for you... :-)
  • barlop
    barlop about 13 years
    @TomWij you're right. This suggestion put together based on dennis's comment and your line and comment, works too C:\nircmd>nircmd cmdshortcutkey "~$folder.desktop$" "TMO2" "Ctrl+Shift+M" monito r off Then the keyboard shortcut works
  • martineau
    martineau about 13 years
    You can do the equivalent without the Win key with the following key sequence: CTRL+ALT+DELETE, ALT-u, then k. Alternatively you could use AutoHotKey to make a macro that just does a SendInput #l. (Note the last character is a lowercase "L".)
  • barlop
    barlop about 13 years
    @martineau I think that does the same as Dennis's suggestion, and is equivalent to windows key with l(el), and brings the welcome screen not a blank screen
  • barlop
    barlop about 13 years
    @martineau I just tried adding this to autohotkey.ahk #o::SendInput #l and then windows key with o, did the same as windows key with l(el).
  • Dennis Williamson
    Dennis Williamson about 13 years
    @barlop: But that answers this request: "a more generic solution that'd work for computers with keyboards without a windows key."
  • barlop
    barlop about 13 years
    @Dennis Williamson what answers it?
  • Dennis Williamson
    Dennis Williamson about 13 years
    @barlop: martineau's comment: "Alternatively you could use AutoHotKey to make a macro that just does a SendInput #l"
  • martineau
    martineau about 13 years
    I was just trying to provide "generic solutions" for computers without a Windows key (since you said you liked the welcome screen).
  • martineau
    martineau about 13 years
    @barlop: Just make you AHK macro be a key combination that isn't triggered by something involving the Win key -- represented by # at the beginning. The macro can still output one, for example ^o::SendInput #l makes CTRL-o do what Win-L does.
  • martineau
    martineau about 13 years
    @barlop: Sounds like you're beginning to understanding -- except for the fact that if you're using AHK, you don't also need NirCmd, SendInput is a built-in AHK function and can do all that is required.
  • barlop
    barlop about 13 years
    @martineau I want a blank/black screen not a welcome screen. I don't know what sendinput line would do that?
  • Dennis Williamson
    Dennis Williamson about 13 years
    @barlop: In the AHK page I linked to in my answer: SendMessage, 0x112, 0xF140, 0,, Program Manager - I just tried it with "blank" as my screen saver and it works.
  • barlop
    barlop about 13 years
    @Dennis Williamson ah, I didn't see that..
  • martineau
    martineau about 13 years
    @Dennis Williamson, @barlop: The SendMessage, 0x112, ... will blank your screen regardless of what, if any, screensaver is set. It turns the video output signal from your graphics card to your monitor(s) off.
  • Dennis Williamson
    Dennis Williamson about 13 years
    @martineau: OK, but that's not what the AHK page says. "Start the user's chosen screen saver:" and "0x112 is WM_SYSCOMMAND, and 0xF140 is SC_SCREENSAVE."
  • martineau
    martineau about 13 years
    P.S. To my last comment about SendMessage, note also that you should proceed it with a Sleep 1000 to give the user time (1 sec) to release the triggering hot keys, otherwise releasing them can wake up graphics system back up.
  • martineau
    martineau about 13 years
    @Dennis Williamson: That's not what the AHK page says, but that's what it does, I just verified it. This has been a permanent AHK macro on all my systems for quite some time. I heard about it in a lifehacker article titled PushMonitOff Links Hot Key Combo to Monitor Power Switch.
  • martineau
    martineau about 13 years
    For anyone interested this Microsoft page lists the various WM_SYSCOMMAND messages and their hex values.
  • barlop
    barlop about 13 years
    windows native keyboard shortcuts seem a bit limited since they only work for items a)on the desktop or b)on the start menu. . i'm not even sure how to list them all..
  • Tamara Wijsman
    Tamara Wijsman about 13 years
    @barlop: Well, you could use AutoHotkey. But it seems you have been helped in Dennis' comments... :-)
  • barlop
    barlop about 13 years
    @TomWij I'm aware of that
  • user1306322
    user1306322 over 10 years
    That only works on a limited number of laptops. But OP didn't specify what device he wants this on, so I guess your answer is ok.
  • barlop
    barlop over 10 years
    @user1306322 given that there are at least hundreds of popular laptops out there, and the probability of it that function making a scree blank is very low.. the specific is not that useful. But the general idea that maybe the laptop has a functio to blank the screen is ok.Perhaps if the answerer showed a screenshot of the picture that blanks the screen, that'd be good.My Fn+F6 key is volume.But if he shows a screenshot then wherever it is if I have that pic I could look. And user, even if I don't have it, somebody else with the same question might(this site isn't for just the 1 questioner)
  • user1306322
    user1306322 over 10 years
    @barlop well then, the next person to ask should specify their PC type and model, which you, by the way, forgot to do. Otherwise, please, add that you're looking for solutions that could suit multiple PC types.
  • barlop
    barlop over 10 years
    @user1306322 this site rejects questions that are too "localized". (and in this case i'd agree with that rule). Questions have to be useful to people. It's not so useful to many people if a question just answers for one particular model of laptop. Or even if people answer regarding 10 models. The chances of any reader having one of those 10 models is slim. They can also (sometimes stupidly I think), reject questions for being too general. I wouldn't make it so explicitly general as to provoke a dumb closure. But sure a Windows solution is general enough to suit different laptop models...
  • barlop
    barlop over 10 years
    and yeah if he includes a picture that works. It's just about giving sensible answers. I can't make a question completely idiot proof from everybody. But the question as it stands is concise and clear and anybody that understands the absolutely sane sensible good rule that the site has, would not answer about specific models and would not encourage answering re specific models. those answers would be downvoted for not being useful. Remember, questions and answers should be useful to not just the person asking. This site is first and foremost a database of QnA.
  • barlop
    barlop over 10 years
    in theory, there could be tags for specific laptop models but the site isn't for that.. if they did that then there would be a swamp of questions and answers of no use to most people, on the one main page. A forum like notebook forum is better for that as at least they have subsections for laptop makes. And by the way, I did ask about a shortcut in the title, that is OS, so would be laptop model independent. Though i'm fine with a solution that maybe 10%+ of laptops have. A lower % and it definitely wouldn't be suitable for the site.
  • user1306322
    user1306322 over 10 years
    IMO the question in its current form is unacceptably broad. But whatever. If you have your answer − good for you. If other people can find their answer too, although it's the wrong question and they're looking in the wrong place − fine. But if you really want to play by the rules, you should provide more details about the solution, like if it has to only use the built-in OS features or can rely on third-party software. Otherwise you're not asking a very specific question to which people give all kinds of answers that may not solve the described problem (in which case they're wrong answers).
  • barlop
    barlop over 10 years
  • Jens Erat
    Jens Erat almost 10 years
    This is device-dependent and no general solution.
  • Máté Juhász
    Máté Juhász over 8 years
    The question isn't about preventing the pc from going to sleep, but finding a way making the screen blank without sleeping the pc, those aren't the same!
  • user237209
    user237209 over 8 years
    Nice simple solution.
  • Polynomial
    Polynomial over 6 years
    This solution is neat, but broken for cases where another application has hijacked the .scr extension for itself (Eagle does this, annoyingly), and also doesn't work in cases where the screensaver doesn't show by default (it is not required to do so by Microsoft's specification). The solution I found for Windows 10 is to link directly to: cmd /c scrnsave.scr /s
  • Kamil Maciorowski
    Kamil Maciorowski about 6 years
    When recommending software, follow this outline please.
  • tinker
    tinker over 2 years
    @Polynomial this is perfect. Mapped to a keyboard shortcut using autohotkey. This doesn't lock the screen after resume, nircmd and SendMessage solutions posted below does.