问题
If system locks every 5 minutes, what VB Scripting method is used to avoid system locking every 5 minutes?
回答1:
Save this file in the format of .vbs Change the Sleep Time 400 based on your requirement.
Set wshShell =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 400
wshshell.sendkeys "{SCROLLLOCK}"
wscript.sleep 400
loop
回答2:
Perhaps, WScript.SendKeys could help: msdn
Something like double-ScrollLock, I guess?
PS. You'll need to put that in a loop with a sleep, of course.
回答3:
The simplest and easiest way is to open windows media player and run the supplied Wildlife in HD video in repeat mode and then minimize it.
Problem solved, it won't allow the system to get lock automatically. No need for VBS.
Another option is to use small utility called Caffeine. Just download, extract and double click the .exe to run. It will run in background and will do the trick for you.
来源:https://stackoverflow.com/questions/32492655/anti-locking-method-in-vb-scripting