Discussion:
RDP Session Does Not Close when Program Closes
(too old to reply)
jueberro
2006-02-02 15:42:05 UTC
Permalink
I have created an RDP Shortcut to start an app directly. When the app
(iexplore.exe) closes why does the RDP session stay open? Aftetr the
user closes IE the grey backround just sits there and you must manually
using the X on the banner? Is there a way to force the RDP session to
close when you launch an app using the Programs tab in the rdp
connection tool, and the user then exits that app?

Thanks,

Joe
Vera Noest [MVP]
2006-02-02 21:21:28 UTC
Permalink
From http://ts.veranoest.net/ts_faq.htm

Q. My session doesn't logoff when I quit my starting or published
application

A. If you define a Starting application, either in Terminal
Services Configuration, a GPO or in your RDP client, your session
should be automatically logged off when you quit the application.
Sometimes, this doesn't happen and you are left with a session
which only shows the desktop background, without the possibility to
log off the session manually. The cause for this problem is a
process which is still running in your session, preventing it from
closing and logging off. The same can happen after quitting a
Citrix published application.

To solve the problem, open a second connection to the Terminal
Server and check in Task manager which process is keeping the
session from closing. Some anti-virus applications are known to
cause this behaviour.
If you can't avoid running the process, you can use a work-around
to log off your session.

Create a batch file, containing something like this:
cd <path_to_the_folder_containing_your_application>
start /wait <application_executable>
logoff

Now define this batch file as the starting application.
Or use the following vb script to launch your application, and
define the vb script as the starting application.

Dim objWshShell, objExec, strAppExe

strAppExe = "<path_to_the_folder_containing_your_application>
\<application_executable>"
Set objWshShell = CreateObject("WScript.Shell")
Set objExec = objWshShell.Exec(strAppExe)
Do While objExec.Status = 0
WScript.Sleep 500
Loop
Set objExec = objWshSHell.Exec("logoff")


For a different solution to the problem, and a list of known
processes which cause this behaviour, check:

CTX891671 - Graceful Logoff from a Published Application Keeps
Sessions in Active State
http://knowledgebase.citrix.com/kb/entry.jspa?externalID=CTX891671

_________________________________________________________
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
TS troubleshooting: http://ts.veranoest.net
SQL troubleshooting: http://sql.veranoest.net
___ please respond in newsgroup, NOT by private email ___
Post by jueberro
I have created an RDP Shortcut to start an app directly. When
the app (iexplore.exe) closes why does the RDP session stay
open? Aftetr the user closes IE the grey backround just sits
there and you must manually using the X on the banner? Is there
a way to force the RDP session to close when you launch an app
using the Programs tab in the rdp connection tool, and the user
then exits that app?
Thanks,
Joe
Loading...