8

PowerShell: Turn off computer screen

 1 year ago
source link: https://gist.github.com/PCHSwS/39e213aac7c574b89673da8dc575e7fa
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Turn off computer screen · GitHub

Instantly share code, notes, and snippets.

PowerShell: Turn off computer screen

Author

Changed SendMessage to PostMessage to not have the script hang upon execution.

You can also use this command line command based on code above:

powershell.exe (Add-Type '[DllImport("user32.dll")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(0xffff,0x0112,0xF170,0x0002)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK