• Home
  • About 404TS
  • Contact

404 Tech Support

Where IT Help is Found

  • Articles
    • Code
    • Entertainment
    • Going Green
    • Hardware, Gadgets, and Products
    • Management
    • Network
    • News
    • Operating Systems
    • Security and Privacy
    • Software
    • System Administration
    • Talking Points
    • Tech Solutions
    • Web
    • Webmaster
  • Reviews
  • Media
    • Infographics
    • Videos
  • Tech Events
  • Tools
    • How do I find my IP address?
    • Browser and plugin tests
  • Get a Technical Consultation
You are here: Home / Articles / Talking Points / Creating a shortcut to put your computer to sleep

Creating a shortcut to put your computer to sleep

2014-03-14 by Jason

I often put my computer at home to sleep when I walk away from it. With Windows 8, that’s a few clicks either way that you do it. I was hoping to find a faster way to do it, so I turned to scripting the process. That way I could just double-click a file or a shortcut on the Start Screen.

I first found the sleep command to run rundll32.exe powrprof.dll,SetSuspendState 0,1,0 but when I ran it, the command hibernated instead of sleeping. Apparently, that’s the only command available for sleep but it chooses to hibernate, if hibernation is enabled. If hibernation is disabled, then the computer will enter the sleep state after running that command.

To be sure, I just included turning hibernation off in my script with powercfg -h off.

[bash]
@echo off
Echo Sleeping… Zzz…
Powercfg -h off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
exit
[/bash]

sleepscript

Now, I created that script as a .bat file and can double-click a shortcut to it on my Desktop whenever I want to put the computer to sleep. I can also pin it to the Start Screen. I even set up the shortcut with a keyboard shortcut so that when I’m on the Desktop, I can press Ctrl+Alt+S to put the computer to sleep.

Other commands that might be useful, you can just substitute lines 3 and 4:

Lock (or press Windows key + L)

[bash]Rundll32.exe User32.dll,LockWorkStation[/bash]

Hibernate

[bash]rundll32.exe PowrProf.dll,SetSuspendState[/bash]

Restart

[bash]shutdown.exe /r[/bash]

Shutdown

[bash]shutdown.exe /s[/bash]

Now, I have an easy shortcut on the desktop and Start screen to click to put the computer to sleep. That should be a bit more convenient.

Filed Under: Talking Points

Trending

  • ESET antivirus false positive blocks website access
    In Security and Privacy, Software
  • The Missing Link: Microsoft releases hardware designed for Windows 8
    In Hardware, Gadgets, and Products, Operating Systems
  • Digital Signage on the Cheap
    In Hardware, Gadgets, and Products

Latest Media Posts

Find Out Where To Download SNES ROMs

Find Out Where To Download SNES ROMs

Multifunctional Video Conversion Tools – Wondershare Video Converter

Multifunctional Video Conversion Tools – Wondershare Video Converter

  • Popular
  • Latest
  • Today Week Month All
  • Access to the resource [servershare] has been disallowed Access to the resource [servershare] has been disallowed
  • Read the Event Logs on Windows Server Core Read the Event Logs on Windows Server Core
  • Increase IIS Private Memory Limit to improve WSUS availability Increase IIS Private Memory Limit to improve WSUS availability
  • How to ‘Unblock’ multiple files at a time with PowerShell How to 'Unblock' multiple files at a time with PowerShell
  • Setup your DFS namespace with DNS for compatibility in a mixed environment Setup your DFS namespace with DNS for compatibility in a mixed environment
  • How Virtual Reality Supports Mental Health Therapy How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting
  • Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams
  • customer contactless payment for drink with mobile phon at cafe counter bar,seller coffee shop accept payment by mobile.new normal lifestyle concept The Latest Innovations In Payment Technology
Ajax spinner

Elevator Pitch

404 Tech Support documents solutions to IT problems, shares worthwhile software and websites, and reviews hardware, consumer electronics, and technology-related books.

Subscribe to 404TS articles by email.

Recent Posts

  • How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting

Search

FTC Disclaimer

404TechSupport is an Amazon.com affiliate; when you click on an Amazon link from 404TS, the site gets a cut of the proceeds from whatever you buy. This site also uses Skimlinks for smart monetization of other affiliate links.
Use of this site requires displaying and viewing ads as they are presented.

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in