3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Shutdown, restart, or hibernate your computer on a schedule

Shutdown, restart, or hibernate your computer on a schedule
In this instructable, I will be showing you how to shutdown, restart, or hibernate your computer on a schedule.

See the notice at the end if you are using an older operating system than Windows XP.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Create a batch file

Create a batch file
«
  • batch.JPG
  • notepad.JPG
  • save as.JPG
First, you must create a batch file (.bat) to be executed. Open notepad (all programs\ accessories). Type in exactly as I dictate:

For shutdown:

c:\windows\system32\shutdown -s -f -t 00                  (or do ...shutdown -p -f)

For restart:

c:\windows\system32\shutdown -r -t 00

For hibernate:

c:\windows\system32\shutdown /h

Save it anywhere you like as shutdown (or whichever accordingly) .bat so it would be "shutdown.bat" for example.
DO NOT save as a -.bat.txt, you are then merely saving text.

« Previous StepDownload PDFView All StepsNext Step »
21 comments
Mar 22, 2011. 2:47 AMDeanGPotts says:
Hi i have a similar instructable and i use the path %windir%\System32\
which windows should recognise on virtually all versions of windows.

Hope this helps :)

Mar 8, 2010. 3:42 AMnehav says:
where to put our mobile number from which we are sending shutdown command
Oct 12, 2009. 11:19 AMchosenone3 says:
Good tutorial ,but windows folder may be on other drive like "D:" :]
Oct 12, 2009. 1:23 PMchosenone3 says:
I know but i think there is a way to shutdown a pc using other method (that doesn't need to have path specified)
Oct 12, 2009. 8:05 PMPadlock says:
A program does not have to have a path specified, as long as it resides in one or more of the directories listed in the %path% variable. To see the path, open command prompt and type echo %path%.
Oct 14, 2009. 12:07 PMPadlock says:
I'm assuming you had meant to reply to my other comment. This is false. With the "/t xxx" switch you can delay it as long asdesired. It is exactly the same as referring to it inside of a batch file.
Oct 12, 2009. 5:18 PMPadlock says:
Hmm. You're creating a batch file to run a single command. Unnecessary?

Next time, just try scheduling the task to run shutdown.exe. And the /h (hibernate) switch for shutdown.exe is only compatible with Vista, and maybe Windows 7. Unsure about the latter though.

Oct 12, 2009. 8:01 PMPadlock says:
Uh, it has to work. A batch file is literally a set of programs with specific parameters to run. You are most likely running it without parameters. In the task scheduler, set it up to run shutdown.exe directly; not the batch file. Where it says "Add Arguments" try "/s /t 30" or another parameter; it should work. It has to work.

Oct 14, 2009. 12:03 PMPadlock says:
I am not sure what you are trying to communicate.

A batch file is a list of programs located within the path. A batch filewith a single command is useless because you can simply refer to thecommand directly. Anything you can do with that batch file, you can do without.
Oct 12, 2009. 1:59 PMlemonie says:
A lot of tasks that will run while you're in bed have the shutdown option: what are you running on this?
(interested)

L
Oct 12, 2009. 11:32 PMlemonie says:
Why do you use this or what for?

L
Oct 13, 2009. 11:20 PMlemonie says:
OK.

L
Oct 11, 2009. 9:29 PMuthus says:
For Linux just edit your cron file:

# To restart daily at say 4 AM:
0 4 * * * reboot  # (or shutdown -r)

# To restart the first day of the month at 4 AM:
0 4 1 * * reboot

# To restart to shutdown at 12:01 AM on New Year's Day:
1 0 1 1 * shutdown

# To restart Monday at 6 AM to be ready for the upcoming workweek:
0 6 * * 1 reboot

# Columns are:
# 1 minutes
# 2 hours
# 3 day of month
# 4 month
# 5 day of week

# for more information `man 5 crontab'

Check this script for hibernating or suspending:
http://www.linux.com/news/hardware/laptops/8253-how-to-suspend-and-hibernate-a-laptop-under-linux

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
6
Followers
12
Author:gamerguy13