Posts

Showing posts from January, 2020

Keep the system active, to avoid the auto lock

Most of the corporate offices will have a policy for screen locking. While working with a long running applications at background, like the automation scripts for testing the applications, it would be difficult to maintain the unlock state of the screen. Thus, we found a technique to keep the system active with a cheating technique. Below is the powershall scripts that keeps the system active ' I am clicking on NUMLOCK for every 5 seconds to keep the system awake Set objNetwork = CreateObject("Wscript.Network")'to get user name numOfHours=inputbox("Hi " & objNetwork.UserName & ", How many hours you want me to be awake? :->") 'time variable conatins the time in hours Set WshShell = WScript.CreateObject("WScript.Shell") 'Creating an object for clicking keys from keyboard numOfMilliSecs=numOfHours*3600*1000 'converting hours to milli seconds While numOfMilliSecs>0 'runs until tym becomes zero WshShell.Send