We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Automate shutdown of your PC after set amount of time

Hi

Do you sometimes leave your computer on overnight because you're downloading or your online backup is going to take a couple of hours?
timeout /t 7200 /nobreak && shutdown /s /f

This will make your computer shut down after 2 hours. If you want to make it longer or shorter, change the 7200 number, this is the amount of time in seconds before the shutdown command is executed.
You can either open "cmd" and type it in, or you can create a batch file so you can just click on that whenever you want to do this. http://www.wikihow.com/Write-a-Batch-File

It'll take a few minutes to create a batch file if you've never done it before, but it'll save you remembering this command!

Hope that helps turn off some power stations!

Edit:
By the way, I realize you could simply write shutdown /s /f /t 7200 but that only works on XP, whereas this works on Vista or XP :).

Comments

  • Good bit of code, but for those who don't want or know how to do this kind of thing, you can just set the computer to go to standby after a set amount of time (in Power Settings), or bit torrent clients (like uTorrent) have a 'shutdown when downloads complete' feature. This way you pc wont shutdown in 2 hours when the downloads may increase to 3 hours.
  • Banacek
    Banacek Posts: 94 Forumite
    I like to use this freeware program shutdown after 2.2 you can read and download here.
    http://www.vcsoftwares.com/sa.html

    Hope that helps.
  • Conor_3
    Conor_3 Posts: 6,944 Forumite
    Seconded. I personally prefer programs that have an option to automatically shut down the PC when finished. The only problem with your method, Gnomemeister, is that it assumes the job will be finished by then.
  • Iconic
    Iconic Posts: 1,021 Forumite
    Part of the Furniture 500 Posts
    Stupid question but why isn't it easier to use Control Panel/Power Options and put the time in there?
  • I use slawdog smart shutdown http://www.slawdog.com/products/smartsd/index.aspx

    It's a freeware and works really well. You can set the time you want shutdown to occur or set a length of time until shutdown.
    Nothing to see here, move along.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 354.3K Banking & Borrowing
  • 254.4K Reduce Debt & Boost Income
  • 455.4K Spending & Discounts
  • 247.3K Work, Benefits & Business
  • 604K Mortgages, Homes & Bills
  • 178.4K Life & Family
  • 261.5K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.