Awesum Stuff

How to Prevent System from Locking during Script run ?

QTP scripts fail to execute when the system is locked/minimized. In order to make your script work when the remote machine on which you are executing is minimized, you can read one of my posts – https://learn2automate.wordpress.com/2013/11/07/how-to-run-qtp-script-in-minimized-mode/

Now that “minimized” is taken, lets take on “locked” ! There are two ways which I use to prevent system unlock, the first one is :-

1. Using a Third Party tool called Caffeine – This is a simple exe which prevents your system from getting unlocked by simulating certain events. It can be downloaded from – http://www.zhornsoftware.co.uk/caffeine/index.html#download

2. Using Registry to disable locking of the Workstation – I feel that this is the most effective way to do this. This is how you can set this up :-

Open up regedit.exe through the start menu search box, and then browse down to the following key, creating it if it doesn’t exist:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

image

On the right-hand side, create a new DWORD 32-bit value named DisableLockWorkstation and give it one of these values:

  • 1 – Disable Lock Workstation
  • 0 – Enable Lock Workstation

The changes should be immediate, no need to restart anything.

Courtesy – http://www.howtogeek.com/howto/windows-vista/disableenable-lock-workstation-functionality-windows-l/

Happy Automating !

Harshit Kohli

Advertisements

Categories: Awesum Stuff

Tagged as: , , , ,

1 reply »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s