How To Make A Batch File
I have seen this question asked many times on the forums here at PCMech. Sometimes, what one takes for granted, makes others scratch their head so I figured this is worth a tip posting.
Suppose you wanted a batch file to simply print the name of your computer. The command you would run would be the following:
echo %computername%
Here is how to make the above command a batch file:
- Open Notepad (you can use any text editor, but I am going to assume Notepad).
- Type/paste the commands you want to be in your batch file.
- Select File > Save As.
- In the dialog, browse to the location where you want to save the batch file.
- Change the “Save as type” option to “All Files (*.*)” and then enter the file name ending with “.bat”, for example: MyComputerName.bat
- Alternate to step 5, you can enter the file name “MyComputerName.bat” (including the quotes) and this will ignore the Save as type setting.
- Click Save.
There you have it. You should now have a batch file in all its glory.
30 thoughts on “How To Make A Batch File”
I’m having trouble posting in the topic.
Kind regards.
It’s of significance.
Best regards.
It’s of significance.
Best regards.
title Matrix
cls
color 2
:start
echo %random% %random% %random% %random% %random% %random%
goto start
\\this is the way to make the matrix
Rather than me explain it, Wikipedia has done a good job:
http://en.wikipedia.org/wiki/Batch_file