Lock Computer after X time of use

Posted on 2004-11-16
Last Modified: 2010-04-12
I want to use a Win2000 machine to show some programs. And I want the computer to automatically LOCK after X time of being unlocked.

A password protected screen saver LOCKs only after X time of inactivity. In my case, I want to LOCK the PC after X time of being UNLOCKED.

Any hints? Thanks in advance.
Question by:elguaxo
    LVL 23

    Expert Comment


    Yes, just one... If this is possible (which i doubt), you will need to use either a VB script or a WMI program.. I don't know how to program (maybe someone else does), but i think that you might have a shot in the programming section...
    LVL 1

    Expert Comment

    Yes, you should try some script (but with that I cannot help)...

    Or just try a software... I know Sysguard ( can do what yo want (but It does not locks the computer with Windows lock, it has its own Lock window... I dont know if that is a problem to you)...

    LVL 10

    Expert Comment

    Download & Install AutoIT v3 - It is free.

    Save the following in autolock.au3 and run it (right click / run script).
    It will lock the computer the 1st time just after his execution
    Then it waits 5 seconds for 15 seconds.

    You can make a .exe from this script. :

    $i = 0

    Sleep(5000) ;five seconds
    WinWaitNotActive("Unlock Computer", "", 5)
    Run("rundll32 user32.dll,LockWorkStation", "", @SW_HIDE)
    MsgBox(4096, "Test", "Unlock in 15 seconds", 15)
    MsgBox(4096, "Test", "Unlock in 10 seconds", 10)
    MsgBox(4096, "Test", "Unlock in 5 seconds", 5)

    $i = $i + 1
    Until $i = 0
    LVL 10

    Expert Comment

    Add the next line to the first line in your script.
    It hides the AutoIT icon in the System Tray.

    AutoItSetOption ( "TrayIconHide", 1 )
    LVL 5

    Accepted Solution

    The famous SysInternals have a great program for this: PsShutdown

    You can run it across the network too, so you can effectively remotely control another system.

    To lock the console after X seconds use the command:

    From the local computer: psshutdown -l -t X

    From the network: psshutdown \\computername -l -t X

    All you need do is execute that program at the start of the demo/show, probably from a batch file that runs as part of the show?

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now