turn monitor off

Costas

Administrator
Staff member
do a new shortcut with the command (fixed with PostMessage vs SendMessage so PS window closes)

Bash:
powershell.exe -Command "(Add-Type '[DllImport(\"user32.dll\")]public static extern bool PostMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)"

source

tested on Windows10x64

ref - Nirsoft.How to turn off monitor from GUI and command-line on Windows
ref - PipisCrew.MonitorSleep



prevent computer to go to sleep

you have to go Control Panel > Power Options > Change when the computer sleeps > choose never for 'Put the computer to sleep'

if for any reason, these is not working search google for mouse jiggler
 
Top