2014-02-02

Level Up - Windows 8: How to Create a Batch File

Batch (*.bat) files are useful because they allow you to save and reuse commands for the command prompt (or CLI, command-line interface). Also, it is easier to send multiple commands at once, fix typos, and edit the commands.

Batch files are available for Windows 7, 8, and 8.1. Any command that you can put in the CLI, you should be able to put into the BAT file.


Method 1:
- Right-click on your desktop (or in File Explorer), and select New->Text Document. Now, rename the file to something ending with .bat.


Method 2:
- Open Notepad, then when you save the file, make sure to end it with ".bat".

Saving a Batch file requires a .bat ending.
Test the Batch file:
Now that you have the BAT file, you can easily test that it works by putting in the following code, then double-click to run the file.
echo Hello, World!


Here's some more things you can try out: Windows Command Prompt Cheat Sheet


Note: If method 1 didn't work for you, then try method 2.

~ Danial Goodwin ~



No comments: