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 am connected to a windows server 2008 R2 server using a terminal TC (thin client). all of our applications are running on the server and if a user is idle for more than 5 minutes, his session will be ended and he will be loged out.

i want to write a program and run it to prevent server from ending my session. i tried using apis for moving the cursor and sending keys to windows but it did not prevented the server from ending the session so what should i do?

thank you in advanced.

share|improve this question

migrated from May 26 '11 at 13:51

This question came from our site for professional and enthusiast programmers.

@Sina that's not the way it should be done! – sra May 26 '11 at 11:30

This is a setting created by your server admin. I would have a word with them about getting it changed instead of trying to hack round it

share|improve this answer
You should configure your Terminal Services or Remote Desktop Services for R2 to just let you idle. It's standard setting you can tweak. – MadBoy May 26 '11 at 14:16

Your Answer


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