VB Script to keep unlock your windows machine

There are times we want to keep our windows machine unlock when not in use or system is left idle for some duration.

Create a new text file, rename to dont_lock.vbs, Right click on the vbs file > click edit and write below lines of script to keep unlock

set wsc = CreateObject("WScript.Shell")
WScript.Sleep (60*1000)
wsc.SendKeys ("{SCROLLLOCK 2}")

The above script will send key events to your machine to keep unlock

Note: keep in mind what keys you are sending, this might effect if any automation scripts are running or any task on desktop running.

For more information on key events, follow SendKeys

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *