- Create a batch file named
turnoff.bat
on your desktop. - Open it and add the following line
powershell (Add-Type '[DllImport("user32.dll")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
- Save the batch file.
- Run the file to turn off your screens.There will be a brief command-line window that pops up during execution.
Tested on Windows 10.
If you want to keep things quieter, you can also consider prefixing the command with an "@" which will ensure that the command is not displayed in the command-line window. If you don't want to command-line window to pop-up, then you can only create a shortcut to your batch file and then go to the shortcut's properties and run it in a minimised window. Note that the window will still appear in the task bar.
Hope this helps!
- Log in to post comments