Preventing sleep with Remote desktop session

djakobovic

Reputable
Nov 21, 2014
4
0
4,510
Dear all,

On a Win7 PC lab we have sleep enabled and want to retain the sleep function. If a local user is logged and has jobs, the computer doesn't go to sleep, as expected. We can also easily wake the computer when initating the remote session.

However, when only a Remote desktop session is active, and jobs (programs that are processor heavy) are started in the session, and the session is disconnected (but not logged off!), the computer goes to sleep, regardless of the programs still running. If the connection to the RD session is kept open, the sleep is disabled.

The question: how to prevent sleep if programs are still running in an active but dicsonnected RD session? Seems silly that a RD session must be kept open to prevent sleep, even if processor is engaged 100% in both cases.

Thanks!
 

proge101

Reputable
Apr 7, 2014
50
0
4,660
You are going to want to go to do this.

1. Go to Control Panel

2. Go to Power Options

3. On the left hand side there should be and option that says "Change when the computer sleeps" click that option if not change whichever plan setting you are currently on.

4. On the drop down box for "Put the computer to sleep" change to whichever you desire, since you don't want it to go to sleep then change the option to "Never" and the bottom of the options from the drop down box.

I Hope this helps
 

djakobovic

Reputable
Nov 21, 2014
4
0
4,510


Thanks for the quick answer, but I _want_ the computer to go to sleep when no user programs are running (e.g. my application has finished and I don't connect for several days) and _not_ to go to sleep otherwise (e.g. if any user application is running).

In answer to 'SomeoneSomewhere', when I leave a computer with open local session and applications (jobs) running, it won't go to sleep, even if the session is locked and noone is at the pc. This is what I want with a RD session, to behave the same. But it doesn't... :(
 

proge101

Reputable
Apr 7, 2014
50
0
4,660


Ok what you can do when you are finished on your computer open command prompt and type "shutdown /h" (without the quotations) this puts the computer into hibernation mode which is a sleep mode and all you would have to do is move the mouse or hit a key and it wakes the computer up.
 

morrisct

Honorable
Aug 2, 2012
18
0
10,520
You can either disable sleep in power options or use a FREE program called "caffeine" created by Zhorn Software. Great little program that pressed a function key in the background every few seconds.
 

djakobovic

Reputable
Nov 21, 2014
4
0
4,510


Ah thanks again for your effort, but I still need the following:
1. if no user programs are running, go to sleep (say in 1 hour)
2. if console sessison is active and programs are running, don't sleep
3. if a remote session is active and programs are running, don't sleep

The problem is, 1 and 2 work, but 3 doesn't... :(

(Long story) why all this, because we have number of students working both locally and remotely, and we want computers to sleep when not being used for days... but to be available remotely. (this works, we can wake them remotely)
 

proge101

Reputable
Apr 7, 2014
50
0
4,660


Ok you are going to want to go this site:
http://www.softwareok.com/?seite=Microsoft/DontSleep

And you want to click this link :
jjhPGJU.jpg


Then this link:
bxjHkQT.jpg


Run the program and edit the settings however you wish.

Hopefully this works for you if not you can try to contact the company whichever program you are running and ask them if they would ad a line of code to prevent the computer from shutting down.

If don't know the code they can visit this site:
http://msdn.microsoft.com/en-us/library/aa373208%28VS.85%29.aspx
 

djakobovic

Reputable
Nov 21, 2014
4
0
4,510


I'm really thankful for your effort, but this still doesn't solve my problem... basically, I just need that a RD session behaves the same as a console session: _not_ to go to sleep when programs running in foreground, but to sleep otherwise (progams idle). For some reason the RD session is not the same...

(Long story) Manually turning sleep off is not the idea, because we run our own programs which run for hours or days (optimization and machine learning) and we don't know exactly how long (until a soultion is found!). Typical scenario: I start jobs on several computers and go for a week. Now I need those sessions _not_ to sleep (of course) while programs are running, and to _go to sleep_ once programs are finished (to save power etc)! I have this functionality if I use console sessions, but since I also need to start jobs remotely, I need the remote sessions to behave the same - and they don't...
Adding instructions to go to sleep at the end of the program execution also is not an option, because there are also student programs, and because several programs are running at one machine.
 

leantricity

Reputable
May 14, 2015
1
0
4,510
This is not an objective answer because I work selling and installing a PC Power Management tool (Verdiem Surveyor) that gives you great control for what you need. You can fine tune CPU, HD i/o and NIC traffic thresholds so you never sleep an "active" computer. You can also set sleep with remote sessions yes/no, and other settings that can make your computers behave the way you need, even you can use "Application Protection", a system to allow you to declare what to do (even custom made scripts) when a certain app is open. I don't know if this is too late or not, but you can also give it a try if you want.