I connecting remotely using remote desktop to windows 7 client when i disconnect the session it automatically logged-out the user in the remote client. I want to keep the user logged-in on the remote client after i close the RDP session.

Thanks in advance


I think this would work, connect from the remote machine with the /admin option like so...

mstsc /v:windows7machine /admin

And then when you go to disconnect, you can run this command from the client to keep the session alive and redirect the session to the console...

tscon 1 /dest:console

[EDIT] I should add, this is kind of a trick for managing a HTPC through RDP, since you can login through RDP (hiding the desktop locally), queue and start a movie, then disconnect the RDP session while redirecting it's output to the local display (unhiding the desktop locally).

If it's an Active Directory environment, check to make sure the option End a disconnected session isn't checked under properties for the affected user in ADUC.

  • As i understand the second command should be executed on windows 7 machine: but i got this error SessionID 1 not found, the same is on the local machine – alonp Nov 25 '10 at 7:57
  • 1
    Run the command query session and replace the number 1 with the ID of the appropriate active session. – CurtM Nov 25 '10 at 8:04
  • Several good command line answers have been posted here: superuser.com/questions/303927/… – JonathanDavidArndt Sep 1 '17 at 16:27
  • @CurtM Hello, does this work if we want to maintain a running GUI application after disconnect? – Vesnog Jun 6 '18 at 22:08

No way.

Here is the trick: Under normal conditions Win7 does not log you out when you just close the remote desktop client. The session keeps open. I am currently in about 4 or 5 remote sessions with this mechanism, most "not active" in that there is no client connected.

So, basically, the admin has confiogured it so that this happens. This means actually that you bypassing it is hard, and in addition a violation of your corporate policy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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