By default, after you lock your workstation (computer), the display turns off automatically in 1 minute, and the lock screen display off timeout can only be increased. For some users, the 1-minute interval is not sufficient, and they need a mechanism to automatically turn off the monitor immediately after the computer is locked.
In this article, we’ll see how to automatically turn off the monitor automatically when you lock your computer (Win + L). Instructions in this article apply to all (Pro versions and higher) of Windows, including Windows 10.
Automatically Turn off Monitor when you Lock your Computer
Turning off monitor & locking the workstation can be automated using a Windows Batch file. But it won’t help if the computer locks automatically after the screensaver or Sleep timeout. So, we’ll see how to use Event Triggers to accomplish the task.
Windows Pro versions have the Local Security Policy Editor which allows you to audit logon events. First, enable auditing of successful account logon events via Security Policy console. After you enable auditing, every login, logoff, lock and unlock workstation events are recorded in the Windows Event log. In Step 2, we’ll attach a scheduled task for the “lock workstation” event.
Step 1: Enable audit of logon events
- Open the Local Security Policy (
- Expand Security Settings → Local Policies → Audit Policy
- Double-click Audit logon events
- Enable the checkbox for Success, and click OK.
- Exit Local Security Policy console.
Step 2: Create an Event Trigger for “Lock Workstation” event
Before proceeding, we’ll need NirCmd or Wizmo utility to automate the task of turning off the monitor. Check out the article How to Turn Off Monitor Using Shortcut or Command-line in Windows for a brief overview of these tools and their download links.
After you enable auditing as in Step 1, workstation lock events are recorded in the Security event log as Event ID:
4800. (Unlock workstation event has ID
- Lock the workstation once using Winkey + L and then unlock it.
- Open Event Viewer (
- Expand Windows logs → Security
- In the middle pane, locate the recent event having the ID 4800.
- Right-click on the event, and click Attach Task To This Event
- In the next screen, assign a name for the scheduled task and click Next.
- In the next screen, the Event ID and source are automatically filled up. Click Next.
- In the Action window, click Start a program, and click Next.
- In the Program/script: box, type in the path to
- In the arguments box, type
monitor offas the parameters and click Next.
A new scheduled task is now created, which will be automatically triggered when you lock the workstation using any method.
The new task is stored under Task Scheduler Library → Event Viewer Tasks in Task Scheduler. This is because the above task was created via Event Viewer Attach Task To This Event (a.k.a. Event Trigger) option.
Editor’s note: After some time, if you think you no longer want to turn off monitor when locking the computer, reverse the steps listed under “Step 1” so that your Security event log is not flooded with login/logoff/lock/unlock workstation events. Then, manually delete the scheduled task using Task Scheduler.
You can also use a Windows Batch file to lock your workstation & turn off monitor in a single click. Again, you’ll need NirCmd or Wizmo.
Create a Batch file (say,
lock-and-turn-off-monitor.bat) using Notepad with the following contents:
RunDll32.exe user32.dll,LockWorkStation C:\Windows\nircmd.exe monitor off
Running the Batch file will accomplish the task!
That’s it! Press Winkey + L to lock the workstation now. It will automatically trigger your “Turn off monitor” scheduled task, and your monitor(s) will now turn off automatically!
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.