Tuesday, April 26, 2011

How to lock the computer after completion of script execution in QTP?


The good thing about Automation Testing is that Scripts are run in an unattended mode. Usually, people do - prepare the batch of scripts and leave for their homes. After the batch got executed, no matter even if it passes or even get failed, the PC has to be locked .So that, avoiding others to view your information related to your project which makes us a good practice.

Set obj = CreateObject("WScript.Shell")
sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
obj.Run sCmnd, 0, False

No comments:

Post a Comment