Vbscript to keep computer active

machine acquire locked in the time of the automation script run-time , this is bereason there is a long interval in between various scripts that(this is forced for some reasons) . I desire to prevent this auto locking attribute. The difficulty is, as per security plans we cannot disable this function from control panel. Is there any various other method to save the device unlocked?


I"d think that you can halt the locking by sfinishing a keypress at constant intervals, so I"d imply looking at WScript.SendKeys. Then put that in a loop with a sleep to make it send it consistently.

You watching: Vbscript to keep computer active

Just be mindful about what essential you"re sending so you don"t impact anything else though.


I did this...It sends 2 SCROLLLOCK Keys, conveniently, so it wont interfere (well, not anything major anyways) with any applications. It does this every 60 secs....Cheers!

collection wsc = CreateObject("WScript.Shell")DoWScript.Sleep (60*1000)wsc.SendKeys ("SCROLLLOCK 2")Loop


I use a pair of files...

The initially file (Keep_Awake__start.vbs) keeps points awake/unlocked. The second file (Keep_Awake__end.vbs) conveniently terminates the procedure when you desire to go back to a normal proces.

See more: Javascript Window Close Not Working In Ie By Using Javascript

The first file...

" Keep_Awake__start.vbs" Graham Edwards" Common stored in Start Menu "" Use Keep_Awake__start.vbs to save the computer system from inactivity-based lockouts." Use Keep_Awake__end.vbs to remove Keep_Awake__start.vbs" Largely pulled from st0le response" Http://classiccomputers.info/questions/4457907/how-to-prevent-auto-locking-feature-of-an-xp-machine-using-vbscript" --- Define Object set wsc = CreateObject("WScript.Shell")" --- Loop eexceptionally so many kind of minutes and also readjust the scroll lock establishing Do " Wait for ~2 minutes WScript.Sleep (2*60*1000) wsc.SendKeys ("SCROLLLOCK 2") LoopThe second file...

See more: Tenda Wifi Usb Driver 802.11 N Wlan, Download Tenda W311M Wlan Driver 4

" Keep_Awake__finish.vbs" Graham Edwards" Use Keep_Awake__start.vbs to save the computer system from inactivity-based lockouts." Use Keep_Awake__finish.vbs to rerelocate Keep_Awake__start.vbs" Largely pulled from Ansgar Wiechers response" http://classiccomputers.info/questions/22324899/kill-a-vbscript-from-another-vbscript" --- Define Object Set wmi = GetObject("winmgmts://./root/cimv2")" --- Search and also Destroy qry = "SELECT * FROM Win32_Process WHERE Name="wscript.exe" AND NOT " & _ "CommandLine LIKE "%" & Replace(WScript.ScriptFullName, "", "\") & "%"" For Each p In wmi.ExecQuery(qry) p.Terminate Next" --- Clean up Set wmi = Nopoint " Release the Application objectThe papers deserve to both be produced from a regular text editor and also stored anywhere (choose your desktop). Once you save the file via a .vbs file extension, it is executable. So, you simply need to double click on the file icon to acquire things to begin or finish (relying on which file you double click).

You might keep the Keep_Awake__begin.vbs in the Windows Startup folder, so it launches as quickly as you log in.