Saturday, May 3, 2014

Script to resume Windows from suspend/hibernate/lock/sleep state

Sometimes we like windows not to unlock it automatically. Of course we can configure this setting, but in some cases, company policies stop you to change this configuration and your windows system keep on locking after a specified time. Following script helps you to get-rid off that problem.


  • Copy following script in a file and save it as .vbs file(Say numlock.vbs). 
  • Right click on this file and open with Microsoft@ windows based script host
  • This script sends signal to to lock/unlock your numlock key which will keep your system active. 
  • To stop this script, go to task manager - processes, check the process with the same file name and close the process. 

x=1
Do while x<>5
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"
WshShell.SendKeys "{NUMLOCK}"
WScript.Sleep 180000
Loop