0

I need a shortcut to turn off my monitor (not put my computer to sleep) that doesn't require downloading a third party application.

John
  • 141
  • 6
  • Nirssoft Monitor will do this. You must download it but is very light weight and does not need to be installed. – John Oct 03 '22 at 00:18

1 Answers1

0

Managed to make a solution. Posting here for future reference.

Created a shortcut and set this as the target:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "(Add-Type -MemberDefinition '[DllImport(\"user32.dll\")] public static extern int PostMessage(int a, int b, int c, int d);' -Name f -PassThru)::PostMessage(-1, 0x112, 0xF170, 2)"

Thanks to Jari Turkia for the original snippet. https://superuser.com/a/1542141/327522

Edited down to work via command line and within 255 character limit.

John
  • 141
  • 6