Anti-locking method in VB Scripting?

天涯浪子 提交于 2021-02-18 18:37:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!