make pc sleep after 40 mins even if mouse is moved

Posted on 2011-03-25
Last Modified: 2012-05-11
hi all i am trying to set a timer to make a p.c go to sleep mode after 40 mins

i have looked at some stuff already but cant find anything to make it sleep

"shutdown -s -t 20000"

-s for shutdown
-r for restart
-t for time

what about sleep?

i would like to put the p.c to sleep after 40 mins even if the mouse moves. (mouse is very high DPI and moves when the traffic out side goes by i live by a busy street) :S

if there is a way of doing it can i make a shortcut and make the command run when the shortcut is opened .cant remember how i did it last time.

i run windows 7
Question by:helpchrisplz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 35213752
This command:

rundll32 powrprof.dll,SetSuspendState

makes the computer go to sleep. Just make a .cmd file with this command in it, and schedule it to run whenever. :)

Expert Comment

ID: 35213771
Disable mouse as wake-up event.
LVL 17

Expert Comment

by:Sikhumbuzo Ntsada
ID: 35213955
I tried the following it worked on my win 7:

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 35218878
rundll32 powrprof.dll,SetSuspendState

ok how can i set a timer? so it waits 40 mins
LVL 25

Expert Comment

by:Lionel MM
ID: 35222084
What version of Windows do you have--if Windows 7 ignore this--has compatibility issues
Check out this link

One of the tools is called sleep.exe which can be run with a time parameter
sleep n where n is seconds so for 40 minutes its 40 * 60 or 2400
sleep 2400

test it by doing sleep 1 (1 second)

If you have Windows 7 you can create a batch file like this

C:\Windows\System32\Choice /c:yn /t:2400 /d:y
rem      rundll32 powrprof.dll,SetSuspendState

LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 250 total points
ID: 35222104
sorry--for windows 7
C:\Windows\System32\Choice /c:yn /t:2400 /d:y
rundll32 powrprof.dll,SetSuspendState

Author Comment

ID: 35225863
yes thank you that is great but its going to hibernate with rundll32 powrprof.dll,SetSuspendState

is there no way to trigger sleep mode?

hibernate is great but sleep is quicker to restore from.
LVL 25

Expert Comment

by:Lionel MM
ID: 35226116
What version of Windows do you have?
Have you setup the Power Options (Control Panel) for Sleep mode instead of hibernation? This command does what the settings are in the power options!

Accepted Solution

binary_1001010 earned 250 total points
ID: 35227382
you might want to download WinOff. it is free.

Author Closing Comment

ID: 35227993
thank you i decided to go with WinOff it does everything i need and more

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question