As soon as someone clicks on this .bat file, these below popup’s will be displayed..

Other options that you can use along with the shutdown command are :
To shutdown computer -> “shutdown -s”
To restart computer -> “shutdown -r”
To logoff computer -> “shutdown -l”
To halt a restart/shutdown –> “shutdown -a”
You can use all these commands directly in DOS prompt or in a script.

You can add some more features to this notepad by reading the help topics in your dos prompt.

Just type help after you enter the dos prompt ( C:\>help ).

Not recommended:
If you remove the pause statement from above code and put this file in the startup( C:\Documents and Settings\All Users\Start Menu\Programs\Startup or C:\Documents and Settings\current user\Start Menu\Programs\Startup ) folder, then your computer will shutdown(automatically) when this file loads at startup.

This article is written to teach you the method to troubleshoot your computer yourself, if someone uses this technique and creates problem in your computer.

Solution:-
Just enter into the dos mode(pre-boot mode, using any bootable disks), and search for any file with .bat extension in Startup folder. And if found, just delete it and restart your computer and it will work normally

These type of files are being sent by some anonymous people in IMs and also as attachments in emails. This could create some irritating problem and you may loose some data on your computer that you have not saved. So be careful when you get a file with .bat file extension. Better not to click on it.

21 thoughts on “Use Notepad(.bat) to Shutdown your PC(Windows Only)”

Great blog here have just found it sorry to say, but at least I have found it by way of Shafar’s blog Tips Blogger(which is a great blog). Good tips and precautions on the shut down cp, and beware of dot bat! Thanks for the heads up!

@darksentry, hmm..its working perfectly for me.
Do one thing, replace the last line in the notepad by shutdown -s
Remove -t 30 -c “f*ck off” from the last line and try to run the .bat file and tell me, whether its working or not.

This technique is never gonna work in a Notebook only for PCs, tried many (differnt platforms) times but no responce after runing the script.
— but here is another tip i got somewhere
>>> right click on your desktop and select New->Shortcut
>>> where u are asked to enter the Location type shutdown -s -t 50 -c “f*ck off”
>>> and the name of the shortcut u’l decide
>>>thats it, run it and seat back & see

I was wondering is there anyway to change the file name, or make it appear to be something different than .bat… Like oh say .jpg? I can create my own icon and change the icon to hide/mask some of it, but can’t figure out how to change the file name extension.

@Sora, No you can’t change the file extension. If you change the extension from .bat to anything else, this wouldn’t work as described in above article.
You can only change the file name. However you can change the file icon to something else and people will usually not see the file extension before opening it. Most of us determine by seeing it’s icon!