Instructables

Step 3: Create the "shutdown.bat" file

Picture of Create the
The "shutdown.bat" file is a batch file that can allow you to auto-launch applications and perform tasks just by opening it up. You can make this batch file do pretty much any Windows function you want, but for this tutorial, we are going to write a script to shutdown the computer. Here's how:

1. Open up "Notepad" by going to Start > Run > "Notepad" and then click OK.
2. In the notepad editor, type in:
c:\windows\system32\shutdown -s -f -t 00
3. Save the file to your computer. You can put it pretty much anywhere on your computer. I put mine on my C: drive.

What this batch file does is it points to the shutdown function on your computer, generally located at c:\windows\system32\shutdown. You may want to double check this, as some computers may have it listed as c:\winnt\system32\shutdown. If this is the case, then you want to change your batch file accordingly. The -s tells it to shutdown the computer. The -f tells it to force the computer to shutdown so that it doesn't get hung on any open applications. The -t sets the time for it to wait before it actually shuts down. You can set it to whatever you want, but I put in 00 to set it to zero.
 
Remove these adsRemove these ads by Signing Up
Gregorid21 days ago

Yes but better thing to do is with Task Scheduler directly. Here is the link so you can made it by yourself step by step : http://pc-problem-solutions.blogspot.com/2014/02/set-automatic-shutdown-on-your-pc.html

eschneider32 years ago
how do you change the file so you can sleep the computer? or is there a different script or command to do that as well? if so, please tell me. :)

WIN 7 & 8 "SHUTDOWN.EXE /H" - HIBERNATE

sykot1c4 years ago
Will This Work With Windows Live Mail?
me1hi066 years ago
Will this work if you want to start your computer or have it hibernate? ... Or even wake up from hibernation?