Batch File Basics Unveiled - Quick & Simple Steps

Batch File Basics Unveiled - Quick & Simple Steps

Robert Lv13

Batch File Basics Unveiled - Quick & Simple Steps

Batch file is a computer file containing a list of instructions to be carried out in turn.

For example, you need to constantly run several commands to refresh your network settings, and repeating the same procedure over and over again could be time consuming. Or there are a number of websites that you need to open in order to work, and it could be annoying to have to open them one by one every time. A batch file can help you solve the headache.

In this post, we will show you how to easily create your own batch file to make things so much easier!

Basically, you just need to do the following things to create a batch file that automatically runs the commands:

  1. Open aNotepad , or aNotepad++ document, but not a Word document;

  2. Bear in mind basic commands:

echo: TheON orOFF option for ECHO turns the echoing feature on or off. If the ECHO is on, the CMD will display the command executing.

pause: S top the running of Windows batch file;

start “” [website] : Go to website using your default browser.

  1. Save your file with the file extension**.bat** ;

  2. Double click to run the batch file and right click and chooseEdit for further edit.

As mentioned above, a batch file can help you troubleshoot frequentnetwork issue . You may be aware that you need to type in_ipconfig_ and some other commands to run the troubleshoot, but you don’t have to do it again and again whenever you have network issues. Let’s see how a batch file helps you with that!

  1. Right click on a blank space on your desktop and selectNew , and then chooseText Document from the list.

  1. Double click to open the text document. Then type in the following commands:

ECHO OFF
ipconfig
ipconfig /flushdns
ping google.com
tracert google.com
PAUSE

When you finish typing the commands, chooseSave as… and then changed the file name to a name ends with**.bat** (we go with network_diagnose.bat ) and sve the file type asAll Files . Then hitSave button.

  1. When double click to open the newly created batch file, you will see it automatically running the command that you just type in. When the commands finish running, hit any keys to pause and exit.

NOTE : There are many more commands in Windows that you can create a batch file with. If you need, just look for them in search engine and repeat the above procedure to create a batch file fast and easily!

Another handy usage of batch file is that it opens your favored websites all at once when you run it. Here is how you do it:

  1. Right click on a blank space on your desktop and selectNew , and then chooseText Document from the list.

  1. Then open the newly created document. In the document, copy and paste in your favored websites’ names withstart “” in front of them. The screen shot here is just an example.

  1. Hit theFile button on top and chooseSave as… .

  1. Change the file name as you like it with**.bat** in the end and then choose the save the file asAll Files type. HitSave button.

  1. Now double click the newly created batch file and you will see the websites all open automatically using your default browser.

Easy and handy, right? Batch scripts are there for you to help you with all the tedious work that needs to be done over and over and over. Free your head and see what you can do with it now!

SwifDoo PDF Perpetual (2-PC) Free upgrade. No monthly fees ever.

  • Title: Batch File Basics Unveiled - Quick & Simple Steps
  • Author: Robert
  • Created at : 2024-08-18 21:11:01
  • Updated at : 2024-08-19 21:11:01
  • Link: https://techtrends.techidaily.com/batch-file-basics-unveiled-quick-and-simple-steps/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Batch File Basics Unveiled - Quick & Simple Steps