Last active
February 26, 2024 14:37
-
-
Save si-hyeon/d8430d132bda8c2b1a689c5d11d5a60d to your computer and use it in GitHub Desktop.
Powershell script to keep the key signal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Send a key that not used well on your environment | |
| # This way works well for screensaver activated by secure program on Windows 7 | |
| # key mapping ref. https://technet.microsoft.com/en-us/library/ff731008.aspx | |
| $myshell = New-Object -com "Wscript.Shell" | |
| while ($true) | |
| { | |
| $myshell.sendKeys("{NUMLOCK}{NUMLOCK}") | |
| Start-Sleep -Seconds 60 | |
| } |
Author
Line 4 is:
$myshell = New-Object -com 'Wscript.Shell"Should be:$myshell = New-Object -com 'Wscript.Shell'Difference being the soft/hard quote at the end.
Thanks. I fixed it as you said.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 4 is:
$myshell = New-Object -com 'Wscript.Shell"Should be:
$myshell = New-Object -com 'Wscript.Shell'Difference being the soft/hard quote at the end.