Terminal Server Close session when the application is finished

lnrivera
lnrivera used Ask the Experts™
on
I have terminal server in a windows 2003 Server. I call a rdp shortcut to run a specific application, how can I close the session automatically when the application is finished?

Regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You would have to disconnect/logoff the session by using time limits...

Terminal Services Configuration under Admin Tools folder
Properties of the RDP-TCP connection, under Session tab.

Override user settings to end a disconnected session after x minutes...
Idle session limit to x minutes...

I know Citrix will end the session if the published application closes, but Terminal Services won't.

Author

Commented:
And I can't do it using some kind of script???

I see RDP in a computer using this feature but I can't access to see how can do it?
I suppose an easy way would be to "publish" a batch file instead of the actual application. Do a START /WAIT <REAL APPLICATION>, then next line would be a shudown /l to log the user off... not pretty but it would work

Author

Commented:
Could be a solution but the application doesn't stop when is running (I use /wait but doesn't work)

Then the batchfile run the application and logoff directly without time to work
This worked for me (its two files to "hide" the window from the user):

login_script.bat
@ECHO OFF
REM login_script.bat
START /MIN published_application.bat
exit

published_application.bat:

@ECHO OFF
REM published_application.bat
TITLE DO NOT CLOSE THIS WINDOW
ECHO WARNING, closing this window will log you off!
start /wait "C:\Program Files\<APP>\<app.exe>" "<arguments>"
shutdown /l
exit

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial