Last active
February 28, 2020 11:05
-
-
Save katai5plate/d7d0eaeea51d1eec74537bf82571fc05 to your computer and use it in GitHub Desktop.
10秒ごとに任意のキーが自動的に押されることで強制スリープを回避したいときのバッチ
This file contains 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
rem = 0 /* | |
:repeat | |
timeout 10 | |
cscript %~n0%~x0 //E:jscript | |
goto repeat | |
rem */ | |
var shell = WScript.CreateObject("WScript.Shell"); | |
switch(Math.floor(Math.random() * 6)){ | |
case 0: shell.sendKeys("{DOWN}"); break; | |
case 1: shell.sendKeys("{UP}"); break; | |
case 2: shell.sendKeys("{LEFT}"); break; | |
case 3: shell.sendKeys("{RIGHT}"); break; | |
case 4: shell.sendKeys("{PGDN}"); break; | |
case 5: shell.sendKeys("{PGUP}"); break; | |
// for VSCode | |
// case 6: shell.sendKeys("^{PGDN}"); break; | |
// case 7: shell.sendKeys("^{PGUP}"); break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment