How to shutdown the computer using cmd or a bat file

Question: I need to shutdown my computer immediately (without waiting) using cmd. How can I do it? From this article you will learn how to shutdown your PC using the command prompt and using the bat-file on Windows 10 example.

How to shutdown the computer using cmd

If you want to turn off your desktop or laptop immediately, follow these steps:

  1. Run the command prompt.
  2. Type the command and press Enter:
    shutdown /s /f /t 0

    shutdown -s -f -t 0
    Your PC will start shutting down immediately:
    windows 10 shutting down

How to shutdown the computer using the bat file

  • Right-click the empty space on your desktop or in any folder.
  • Select New → Text Document.
  • Copy and paste the string into the document:
    shutdown /s /f /t 0
  • Press Ctrl+S to save the file in .txt format.
  • Show extensions for registered file types. Click View – Options:
    explorer view optionsUncheck Hide extensions for known file types: hide extensions for known file types
  • Rename “txt” extension to “bat”:
    rename file extensionThis is an example on how to name the bat file:
    turn off pc bat

    Do not name the file “shutdown”! Otherwise it will launch itself in a cycle and won’t work!

Now all you need to immediately shutdown your computer is just launch the bat-file.

Leave a Reply

Your email address will not be published.