Thursday, August 25, 2011

Lock your system after execution of your QTP Script

Now you can lock your system after your QTP batch script/script execution.
use the below code at the end of your script(batch/regular). your system will be automatically locked,once after script executed.
Public Function Lock_your_system()
    Set obj = CreateObject("WScript.Shell")
    sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
    obj.Run sCmnd, 0, False
End Function

No comments: