Link to home
Start Free TrialLog in
Avatar of kwallace01
kwallace01

asked on

lock workstation - run an application at the same time?

I want to have an application run in the background whenever I "lock workstation". I don't want to bind a shortcut key to a batch file to lock the workstation and launch the program, I want it to launch when the workstation is locked from any source. This can be a service or a program running in the background watching for the user to lock the workstation, or possibly a setting in the registry I don't know about. This is fairly urgent, so I'd like a soloution ASAP.

Thanks
Avatar of sathishkumar_sri
sathishkumar_sri

What you have said cannot be done using just the features of Windows XP itself. However you can write a small program in Visual Basic using the Windows API to check if the workstation is locked and then run the required program/process. I was facing the same problem sometime back and found the following article useful:

http://gethelp.devx.com/techtips/nt_pro/10_minute_solutions/10minNT0701.asp

Hope this helps you!
Avatar of kwallace01

ASKER

Hm. That looks like what I need, but I don't have a copy of VB. :( Would anyone be willing to write me a small app that does this or find a pre-made one?
I am working one right now. I was trying to make it a service but it doesn't work the way I wanted to. This is going to be very basic and a bit crude. It will use the registry to house which program you want to run and the only configurable part will be to set which program you want to run. There will be an icon that sits in the tray.

And the only way to end it will be to kill it using the task manager.
That'll work great. Thanks.
I almost got it. Do you know if the system in question is going to be locked more then once. Or if is going to be locked more than once do you always want the program to run?
The system is going to be locked quite often, actually. I want the program to run any time it is locked, as it will terminate on its own before the workstation is unlocked.
Ok does locked applied to a password protected screensaver?
Nope, the system won't be locked by the screensaver, just by winkey+L and ctrl-alt-del>"lock computer"
Okie dokie thanks that will make it a lot easier. :>)
Ok here is a beta version.

To run it at startup place in the startup folder or use the or

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run


HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

To to tell it which program to run right click on the Tray Icon and select Configure

This is the registry key that it uses
HKEY_CURRENT_USER\Software\CAPC\Run App Locked computer
Programs

http://www.geocities.com/eecrazyone/crazyone.html
scroll down near the bottom to
Run App When Computer Locked
and click on it.
Cool, that works great. There is one issue I have with it, which shouldn't be too hard to fix. I'd like it to check if the computer's locked every 5 seconds, and it looks like it is currently 10-15. Maybe you could add that to the configuration dialog?
Ok sounds like a good idea. It is currently set at 30 seconds so as if somebody does ctrl-alt-del it appears to the program that the computer is locked but the user just might be wanting to get to the task manager instead. However it makes sense to make this configurable so I should have something in the next few hours an no later than this time tommorrow.

By the way I have three other utilities I have put together on that page so if you have time take a look at them and see what you think about them I would aprecaite it. If you don't want to or don't have the time then I understand. But if you know anybody that may find them useful then let them know about the utilities, they are all free. :>)

Registry Backup
Flip Startup Items
Shutdown/Restart
ASKER CERTIFIED SOLUTION
Avatar of CrazyOne
CrazyOne
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's perfect! Thanks!
You are welcome. :>)