Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create sleep-shortcut on desktop

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi,
On a netbook I mostly want the machine to go into sleep-mode instead of shutdown.
Is it possible to create such a shortcut on the desktop?
TIA
-Bart
 
Here's how for XP:

1. Right-click the desktop and select New | Shortcut.
2. When the Create Shortcut wizard’s location text box appears, type: rundll32.exe PowrProf.dll, SetSuspendState
3. Give the shortcut a name like Suspend Now!

source: Sun City Summerlin Computer Club

PS:

[tt]
Shutdown: %windir%\System32\shutdown.exe -s
Reboot: %windir%\System32\shutdown.exe -r
Logoff: %windir%\System32\shutdown.exe -l
Standby: %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
Hibernate: %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate [/TT]

Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
Hi Ben,
Thanks for your help.
But as this is a win7 forum......
Any idea howto in win7?
KR
-Bart
 
From here:


Create a batch file with the following:

@echo off
powercfg -h off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
powercfg -h on

Then create the desktop shortcut and use the Browse to point to the batch file you created. Works perfectly.

It works perfectly, if you run as administrator.

There are reports that it causes hibernation if run as a user.
 
Have a look at some of the desktop gadgets - I have one that has sleep, shutdown, logout, switch user and loads of other buttons. You can customise which ones appear and what order they're in, so you could have just the sleep button.

Unfortunately I'm at work at the moment on Win XP and can't remember what it's called. I found it in the online gadget gallery.

Nelviticus
 
Hi to all,
Thanks for all yr replies.
But I regret to say that none of them did what I want to achieve.
Get the machine in sleep or st.by.

The desktop gadget is nice but does not have st.by or sleep mode available.
The scripts are working fone for XP but in win7 it says I am not permitted to put the machine in hibernate mode. Than it shuts down the machine.

Any other suggestions?

KR
-Bart
 
If you get a message that you are not permitted to put the machine in hibernate mode, you are probably not running the script as administrator.

Open notepad and copy the following into a new file:

@echo off
powercfg -h off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
powercfg -h on

Save this file to the desktop as standby.bat.

Right-click the newly created standby.bat and select Create shortcut

Right-click the new standby.bat shortcut, and on the Shortcut tab, select Advanced, and check the box for Run as administrator. You may need to give the administrator password.

The shortcut should now just send the system into standby. It does on Windows 7 Ultimate.

Perhaps the Netbook Windows 7 edition you have behaves differently, if this does not work.




 
By default, clicking the Shut down button on the Start menu shuts down your computer. You can change this so that instead of shutting down, your computer logs you off, locks, restarts, goes into a sleep state, or goes into hibernation."



"Change what happens when you press the power button on your computer" is a Help and Support program's article.
 
Right click on the Start Button, select Properties, and on the Start Menu tab select Sleep instead of Shutdown for the Power Button action. OK your way out.

You will now see Sleep as the default action when you hit the Start button.

Hope this helps.

Please help us help you. Read Tek-Tips posting polices before posting.
Canadian members check out Tek-Tips in Canada for socializing, networking, and anything non-technical.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top