Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have users running an application on a terminal server using a shortcut that has "Start the following program on connection".

Normally when they exit the application the terminal server session automatically logs out.

Sometimes when the application exits their session doesn't end. They are left with a 'blue screen' (a blank desktop). They usually disconnect and wait for the disconnection timeout to automatically logout their session.

My question is what would cause the session to stay stuck open after the application quits?

I have tried updating to the later RDP client. The clients are XP sp3. The server is Server 2003 R2 SP2.

The clients are using redirected Desktops and My Documents folder, and roaming profiles. There was a permission problem on the Desktop and Documents folders that was causing an error to be logged that redirection failed. I took ownership of the folders and subfolders in the user's name and that fixed that error from being logged but didn't fix the 'blue screen' problem.

share|improve this question

My question is what would cause the session to stay stuck open after the application quits?

Bugs in the application that got started, or bugs in something else that is loaded when the user connects can cause something like this.

Sometimes filehandles or registry handles are left open. Usually you can track this things down using filemon or regmon. You may also want to try oh.exe (open handles) that is part of the 2003 resource kit.

If you haven't already you may want to trying installing the User Profile Hive Cleanup Service. It is supposed to help force things closed after disconnection.

share|improve this answer

Im thinking it may be related to one of two things:

  1. A logoff script that's hanging up or

  2. The permissions are still screwy somewhere. Normally I would say it was a problem with the roaming profile permissions but in your case here's what I would suggest:

Backup and then delete the redirected My Documents and Desktop folder for one of the affected users, have the user log on which will cause Windows to recreate the redirected folders with the proper permissions (as long as the Share and NTFS permissions at the root are correct). Have the user log off and see if the problem is gone. If so, then that will confirm that the permissions on the redirected folders are the cause of the problem.

If it doesn't work you can try the same thing with the roaming profile by deleteing it for one of the affected users and testing it with a log on and log out.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.