Hi! Welcome to my Batch File Guide, I am relatively new to the batch language. This is not an extremely detailed guide, because I believe that it is good to learn about this much of Batch and then start learning something like Python. Also, if you have any suggestions or see something wrong with my guide, then please contact me, I like feedback. Remember, if you like my Instructable, please comment, favorite, and or SUBSCRIBE! Thank you.
Step 1: Saving Your Batch File
After you write your batch program in your text editor (I use Notepad), you have to save the program as a .bat file. So you save it as your_file_name.bat, you must have the .bat ending every time or it will save as a .txt file instead of a .bat file.
Step 2: Printing "Hello, world!" Onto the Screen
Well, your long awaited first batch file shall come at last. In it, you will print "Hello, world!" onto the screen. The function to print text onto the screen in batch is echo. Another thing to know is, in most batch files you make, the first line of code is @echo off, this makes it so the echo is hidden and it only shows the text you want to be shown. Now, put that into your code and then put echo Hello, world! on the next line. Now, if you save it as hello_world.bat and double-click on the batch file, it will open a CMD window and close it really fast. To keep it open and to let the user see the text you must use the pause function, so, on the next line type pause. Now finally, you are done, save it and double-click on the batch file icon. It should open a CMD window, print "Hello, world!" in the window, and say "Press any key to continue . . . ", after you press any key the window will close. Congratulations, you just made your first batch file!