Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How to disable sleep mode programmatically

20 May 2010   #1

Windows 7
How to disable sleep mode programmatically

I have a application that runs for several hours. The problem I am having is that Windows 7 goes to sleep while my application is running. I know I can manually disable the sleep mode, but I am hoping there is a way I can enable/disable the sleep mode from within my application. That way I can disable the sleep mode when my program starts and I can enable it again when my program finishes. Is there a way to do this? Is there another way to prevent Windows 7 from going to sleep while my program is still running? Is there a DontGoToSleepBecauseMyProgramIsStillRunning command that I can execute every few minutes to prevent Windows 7 from going to sleep while my program is running?

My System SpecsSystem Spec
20 May 2010   #2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86

You can download the app called Insomnia.
My System SpecsSystem Spec

 How to disable sleep mode programmatically

Thread Tools

Similar help and support threads
Thread Forum
Laptop freezes between entering sleep mode to being in sleep mode
Hi, I've had this problem intermittently on my laptop for the past 2 years however it has been occuring more often recently. Basically sometimes when I click the sleep button on Windows 7, the screen fades to black as usual. However the fan keeps running (sounds like when it's on full load) and...
General Discussion
How to programmatically change COM port FriendlyName
I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed. ...
Installation & Setup
Disable Hybrid Sleep?
So I've already posted my Win7 randomly entering sleep mode and not waking up. I've found one of the things that can fix it is to disable hybrid sleep. However, I can't see that option. My account is automatically set as administrator so I should beable to see the "Change the unavailable power...
General Discussion
How do i use hibernate mode without going into sleep mode first
I want windows media center computer to go into hibernate mode only. Now it goes to sleep after 25 min and then hibernates after 30 min. How do i set it so it will go right into hibernate mode? thanks:)
Mute the audio mixer application programmatically
hello all, I try to mute/unmute the available application mixer individually (not the master sound). Does windows provided any API to get this thing done? Thanks for help...
Sound & Audio
Sleep : Disable ... New Tutorial
I've been goofing around with this for a while; I hope others find it useful. :) Sleep : Disable in Shut Down Menu
Chillout Room

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:02.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App