Mar 16, 2016

Make an Auto Shutdown USB

shutdown usb

Auto Shutdown USB

Before you learn how to make an auto shutdown USB, it is important to know that this is just for educational purposes and can be considered illegal if used on certain private PCs. Therefore, I take no responsibility if you get in trouble with this. [Use with caution] The setup can be done with the help of writing a little bit of code in notepad and making a .bat file and a .inf file and putting these files in a USB drive. So, let’s begin.

How to Setup the USB

First of all, go find yourself a cheap old USB drive that you don’t use, because the USB stick we will be using will be dedicated for this purpose, and would automatically shutdown a PC when the PC turns on. Therefore, you won’t be able to use it for other tasks.

Now, open notepad and copy paste the following code:

[autorun]
open = launch.bat

Now, save the file as autorun.inf
It is important that you save the file with a .inf extension otherwise the file would run automatically when the USB is plugged in.

We have to make one more file in notepad that would actually tell the PC to shutdown. So, open notepad again, and type the following code:

c:\windows\system32\shutdown -s -f -t 20

Save the file as launch.bat
Here it is important that you save it as launch.bat because the previous file that we made auto runs and opens this file automatically will would run the showdown command.

-s is the command to shutdown the PC
(If you want to restart the PC instead, replace -s with -r in the code.

-f command allows force shutdown

-t 20 means the computer would shutdown after 20 seconds.
(You can change it to any number of seconds, but I recommend not going below 20 seconds, because for example let’s say that you set the time to 2 seconds, then you won’t be able to edit these files in the future because whenever you would plug in the USB it would automatically shutdown the computer in 2 seconds and you would not have enough time to abort the shutdown procedure.)

Now, you have two files named as autorun.inf and launch.bat

Upload them to your USB drive and restart your computer to test. And, if everything was done right, your computer should shutdown in 20 seconds.

How to Abort Shutdown

1) Open Command Prompt by tying in cmd in the search bar.

2) Type shutdown -a to abort the shutdown process.

 

How to edit the files in future:

If you want to make changes in the 2 files that we made. You can simply right click on the file to open them with notepad and you can then easily change the code.

 

Have a little bit of fun with your Auto Shutdown USB

Plug your USB stick in the back of your friends desktop computer and leave it there and watch his reaction when he won’t be able to use his PC for more than 20 seconds. Whenever the computer is turned on, it would automatically shutdown. [Remember: Just for Fun!]

 

The purpose of this tutorial was to introduce you with .bat and .inf extension, and basically how easy it is to make these files to automate tasks in windows with the help of notepad. If you guys want to see more articles like this make sure to like our Facebook page and comment below.

Article Tags

Related Posts

css.php