Skip to content

Instantly share code, notes, and snippets.

@si-hyeon
Last active February 26, 2024 14:37
Show Gist options
  • Select an option

  • Save si-hyeon/d8430d132bda8c2b1a689c5d11d5a60d to your computer and use it in GitHub Desktop.

Select an option

Save si-hyeon/d8430d132bda8c2b1a689c5d11d5a60d to your computer and use it in GitHub Desktop.
Powershell script to keep the key signal
# 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
}
@Hickory420
Copy link
Copy Markdown

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.

@si-hyeon
Copy link
Copy Markdown
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