How to Shut Down a Computer Using Notepad

Written by jen miller
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Shut Down a Computer Using Notepad
(Jupiterimages/Pixland/Getty Images)

Batch (.bat or .cmd) files are unformatted text files and contain one or more commands that simplify tasks. When you run a batch file, the operating system runs the commands in a line-by-line order. You can use Microsoft Notepad to create batch files to run routine tasks, such as shutting down your computer.

Skill level:

Other People Are Reading


  1. 1

    Open Notepad by clicking the "Start" button, typing "notepad.exe" in the text box and pressing "Enter" on your keyboard.

  2. 2

    Type "shutdown" and type the arguments for the shutdown. Add a space with your space bar after "shutdown." Separate arguments, and any values you provide with the argument, by using a space. The argument you use to shut down a computer is "-s". Use the "-r" argument to shut down and restart the computer or the "g" argument to shut down, restart the computer and restart registered programs after the computer restarts.

    For example, to simply shut down a computer, type:

    shutdown -s

  3. 3

    Add optional arguments. Note that some arguments cannot be used if you use other arguments.

    Some arguments you may want to use include "-t", which you can use to specify the time, in seconds, before the computer shuts down and "-c," which you can use to provide a message when the computer is shut down. After the "-t" argument, type the number of seconds; after the "-c" argument, type the comment enclosed in double quotation marks ( " " ).

    For example, to create a batch file that shuts a computer down after 100 minutes and displays the message "Computer shutdown," type:

    shutdown -s -t 6000 -c "Computer Shutdown"

  4. 4

    Save the text file as a batch file. Click "File" and select "Save as."

  5. 5

    Navigate to the location where you want to save the file and type a name for the file in the "File name" field. Use the file extension ".bat." or ".cmd." For example, use the file name "shutdown.bat" or "shutdown.cmd."

  6. 6

    From the "Save as type" drop-down box, select "All Files;" then click "Save."

  7. 7

    Right-click the file and select "Run as administrator" to run the batch file. If you configured optional information such as comments or a shutdown timeout interval, Microsoft Windows displays the information as a pop-up message in the status bar.

    For example, for a batch file with the content "shutdown -s -t 6000 -c "Computer shutdown," the status message indicates that the computer will shut down in 100 minutes and displays the "Computer shutdown" comment.

Tips and warnings

  • You can view the arguments that you can use in a shutdown batch file by clicking "Start" and typing "shutdown /?" in the text box.
  • If the computer is not set to shut down immediately, you can stop the computer from restarting by clicking "Start" and typing "shutdown -a" in the text box.

Don't Miss


  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.