Reputation: 3578
I want to run an application on closing/Disconnecting Remote Desktop Connection. Is there's any way to keep record of Remote desktop session start-stop timing in winndows xp/win 7.
Upvotes: 3
Views: 1142
Reputation: 2737
You can run any program using Task scheduler:
- When the computer enters an idle state.
- When the system is booted.
- When a user logs on.
- When a Terminal Server session changes state.
You can even add tasks from command line
Upvotes: 0
Reputation: 11421
You can write a Windows service and listen for SERVICE_CONTROL_SESSIONCHANGE. One of the parameters for that event is the session state, which in this case you would be interested in either WTS_SESSION_LOGON/WTS_SESSION_LOGOFF or WTS_REMOTE_CONNECT/WTS_REMOTE_DISCONNECT depending on your needs.
Upvotes: 5
Reputation: 9476
On start of remote desktop connection you can try this. Here is a psuedo-code of what you have to do:
Java application (Listener), registered as a Windows Service and runs on system stratup.
Listener application keep listening until some .exe file is opened. (Here in this case It will be mstsc.exe)
Listener execute code (or call another application)
Upvotes: 0