System Lockout API

Does your system lock due to screen saver settings at your company? Are your QTP Test scripts failing because of that? If yes then here is the solution for you.

Knowledge Inbox Prevent System Lockout is COM based component which allow your scripts to block system for getting locked. It is one of the most easy components one can use. How to use it? Just add the below line of code in a VBS attached to your test

As soon as the object gets created the system does not go into locking mode. When the script ends the object is automatically destroyed and the system can now go into the locking mode. To disable the lockout you can destroy the object created earlier

Properties Supported by SystemLockout class

“KnowledgeInbox.SystemLockout” object exposes access to two properties listed below

  • PreventLockout – When set to True the system does not go into locking mode till the object is alive. Default value is False
  • Interval – Interval in millisecond after which the prevention mechanism needs to be executed. By default this value is 30000 (30 sec). This should only be changed in case performance is an issue Usage of Properties


The component is FREE for PERSONAL use. For COMMERCIAL use the component is FREE but permission from Author is required for the same. Your code needs to mention the the Author name and provide this webpage reference to use the component for FREE.

Auto Installation through Scripts

Installing the setup on every machine executing your code might not be feasible solution. You can avoid the by saving the KInboxSysLck.dll in one of the folders present in QTP Tools->Options… and then use the following function to get the object

Installation also adds a reserved keyword SystemLockout to QTP

SystemLockout QTP reserved keyword

SystemLockout QTP reserved keyword

  System Lockout API (210.0 KiB, 3,368 hits)

Have questions related to this article? Want to request a new article? Use our forums to post your questions

  1. Suscribe to Email

    Enter your email address:

    Delivered by FeedBurner