WORKING WITH QTP

TestEveryThinG

Lock the system after QTP script execution completion using VBSCRIPT

Posted by rajivkumarnandvani on September 22, 2010

Hi All,

By using below mentioned script you can  lock the system after QTP script execution completion.

rem  create winshell object

Set obj = CreateObject(“WScript.Shell”)

sCmnd = “%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation”

obj.Run sCmnd, 0, False

Set obj =nothing

Advertisements

5 Responses to “Lock the system after QTP script execution completion using VBSCRIPT”

  1. scriptm said

    tank you man 🙂

  2. You are most welcome 🙂

  3. suresh babu vemuri said

    We have been struggling with the problem of system-locking.
    We don’t want the system to be locked as long as we run our scripts.

    We can’t use the function
    Sendkeys{“NUMLOCK”}, as we don’t have a function which will be called for every 2-5 minutes.
    We have a modular framework. No centralized functions.(We don’t use Recovery scenarios either to call a single function)

    Like the above thing, through qtp code, can we keep system unlocked while we run scripts.

  4. With this type script you can’t use as you said you can’t use send key (keyboard event).
    For this try to use AutoIT tool its an application that will run continue & would not lock your system.
    Just google how to use autoit for system unlock.

    Thanks

  5. suresh said

    Thank you very much for the advice.
    We will try it.

    It may resolve our problems.

    Regards,
    Suresh

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

 
%d bloggers like this: