mattkimura

How to power off screen in Windows

Nov 14th, 2023 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. Right click > New > Shortcut
  2.  
  3. Paste this path:
  4. powershell.exe -Command "(Add-Type '[DllImport(\"user32.dll\")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)"
  5.  
  6. Go to the shortcut's properties to change the icon. Use this path for icons:
  7. C:\Windows\System32\imageres.dll
  8.  
  9. Drag the shortcut to the taskbar and then delete the shortcut file. It'll work independently from the taskbar
  10.  
  11. You'll have to close the window when you wake it back up
Advertisement
Add Comment
Please, Sign In to add comment