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, youmust have the .bat ending every time or it will save as a .txt file instead of a .bat file.
<p>i made any text you want flash colors!</p><p>@echo off</p><p>title RAINBOW TEXT v1.3</p><p>echo Welcome, %username%, to the most useless thing ever.</p><p>echo ----------------------------------------------------------------------------------------------------------</p><p>echo type text here (to make rainbow): </p><p>set /p bleh=</p><p>:a</p><p>cls</p><p>color 0a</p><p>echo %username% says: &quot;%bleh%&quot;</p><p>color 0b</p><p>color 0c</p><p>color 0d</p><p>goto a</p>
<p>Cool, I made something like this.</p><p>If %you%==want to check it out (<br>goto<br><a href="https://www.instructables.com/id/Basic-Batch-command-list/" rel="nofollow">https://www.instructables.com/id/Basic-Batch-comman...</a><br>)</p>
<p>https://www.instructables.com/id/Full-screen-batch-matrix/ </p><p>Full screen batch matrix</p>
Cool! <br>I made a four function calculator: <br>@echo off <br>color 0a <br>goto start <br>:start <br>cls <br>echo Mini Calculator! <br>echo Choose ur first number! <br>set /p fnum=&quot;&gt;&quot; <br>cls <br>goto 2 <br>:1 <br>echo Choose ya operation <br>echo 1 for + <br>echo 2 for - <br>echo 3 for * <br>echo 4 for / <br>set /p op=&quot;&gt;&quot; <br>cls <br>if %op%==1 goto 4 <br>if %op%==2 goto 5 <br>if %op%==3 goto 6 <br>if %op%==4 goto 7 <br>:2 <br>echo Choose ur second number! <br>set /p snum=&quot;&gt;&quot; <br>cls <br>goto 1 <br>:3 <br>echo ur result is <br>echo %res% <br>echo Do another calculation? <br>echo Y/N: <br>set /p rstart=&quot;&gt;&quot; <br>if %rstart%==Y goto start <br>if %rstart%==N exit <br> <br>:4 <br>set /a res = fnum + snum <br>goto 3 <br> <br>:5 <br>set /a res = fnum - snum <br>goto 3 <br> <br>:6 <br>set /a res = fnum * snum <br>goto 3 <br> <br>:7 <br>set /a res = fnum / snum <br>goto 3 <br>
<p>launcher</p><p>@echo off</p><p>title LAUNCHER PRO</p><p>echo Hello %username%</p><p>pause</p><p>:top</p><p>cls</p><p>echo Hello %username%</p><p>echo Would you like to start</p><p>echo 1. Chrome (install)</p><p>echo 2. Internet Explorer</p><p>echo 3. Download Chrome</p><p>echo 4. Firefox (install)</p><p>echo 5. Download Firefox</p><p>echo 6. Opera (install)</p><p>echo 7. Install Opera</p><p>echo 8. Exit</p><p>set /p in=</p><p>if %in%==1 start chrome.exe</p><p>if %in%==2 start iexplore.exe</p><p>if %in%==3 start iexplore.exe https://www.google.com/intl/en/chrome/browser/</p><p>if %in%==4 start C:\Program Files\Mozilla Firefox\firefox.exe</p><p>if %in%==5 start iexplore.exe http://www.mozilla.org/en-US/firefox/new/</p><p>if %in%==6 start C:\Program Files\Opera.exe</p><p>if %in%==7 start iexplore.exe www.opera.com</p><p>if %in%==8 exit</p><p>) else (</p><p>goto loop</p><p>)</p><p>:loop</p><p>cls</p><p>echo %in% is not acceptible</p><p>echo Please write something acceptible</p><p>echo 1 2 3 4 5 6 7 8 is acceptible</p><p>pause</p><p>goto top</p>
<p>Cool, I made something like this in the past : )</p><p>-WorldBuilder</p>
I'm really sorry to be negative about this .. but to be really really honest I would never advise anyone to put much effort into learning 'batch' programming. For one simple reason that a) its not portable (this instructable will work in MS windows and nowhere else) and more importantly b) its kind of a dead end (you start to push the limits quite quickly). I'd suggest that learning a scripting language like Python or Perl, you can do everything you can do in batch and its a gateway to much much more. The only time batch is worthwhile is when your not in a position to install anything better or your writing a smarter launcher/installer.
<p>Hi, thanks for the feedback, and you aren't being negative at all. I whole heartedly agree with you. I recommend people to look a little at Batch and then learn something like Python (that is what I have been learning). I think someone shouldn't get farther than as far as this Instructable goes, because it is just meant for moving files, deleting files, and doing different tasks on your computer. You can make small programs and little games with Batch, but something like Python is way better suited for the job. Thanks for the feedback and I agree with you.</p>

About This Instructable




Bio: Hi! I am learning the Python programming language, I also play some Minecraft . So, I hope you like the stuff I post, and please comment ... More »
More by electronicz:Batch File Guide Simple Long Range Minecraft Cannon Sony Vegas Studio Lightsaber Effect 
Add instructable to: