Lock Computer after X time of use

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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...
Yes, you should try some script (but with that I cannot help)...

Or just try a software... I know Sysguard (http://www.idiogensoftware.com/sysguard/index.php) 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)...

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
Add the next line to the first line in your script.
It hides the AutoIT icon in the System Tray.

AutoItSetOption ( "TrayIconHide", 1 )
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?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.