Thursday, February 9, 2023

HA Bytes is reader supported - So if you purchase through links on our site, we may earn an affiliate commission. More

HomeHow-ToHow to make a Batch File? Complete Guide of 2023

How to make a Batch File? Complete Guide of 2023

How to make a batch file? No Problem, it’s easy.

What is a Batch file?

A batch file is also known as Batch Programming Language, which is used in Windows to automate a day-to-day task. This batch programming language is also used by hackers or crackers to make a malicious virus perform malicious activities on a particular system.

Well, in this guide we will not discuss how to hack a computer using a batch file because it’s not our today topic, we will discuss How to make a batch file, How to run a batch file, and some useful tips and tricks to use batch files.

What are the Requirements in Order to Create a Batch File?

Most people, when hearing it a kind of unique programming language, they think it requires some kind of high-end specs PC but actually it not. You may be surprised, we need nothing all we need is simple Text-Editor, for example, your own computer Notepad or Third Party Notepad++ and that’s it.

In Short: You Need

  1. Simple Computer or Laptop
  2. Text Editor
  3. And Obviously, Knowledge about Batch File

Important Commands of Batch File You Need to Know

Before creating a batch file, you must know some batch file commands that will help you to create the perfect and best batch file. Here, are some simple commands you need to create a batch file;

Echo: It is the starting command of your batch file. You can easily ON and OFF echo, this echo command will display it is executing.

CLS: It is used to clear the command screen.

Pause: Actually, echo and this pause command is very important for creating a batch file. Pause command used in last of a batch file to stop the execution.

Exit: To exit the Command Prompt.

Last, there’s a bunch of commands, but these are the commands you need to create a simple batch file.

How to make a batch file in Windows 10

To create a simple & basic batch file on Windows 10, follow these steps:

Note: When you save your batch file instead of saving with a .txt file extension. Save your batch file with the .bat extension.

Open, your Text Editor first. There are so many Text Editors you can use, Windows Notepad and Notepad++.

Your code must be an in-between echo and in pause command.

Type the following codes in Text Editor to create a batch file.

@ECHO OFF
ECHO Congratulations! Your first batch file was executed successfully.
PAUSE

When you type these codes in a text editor, “Save As” with the .bat file extension. After saving, open your batch file now you will see the command interface.

Congratulation, your batch file is now created. See, creating a batch file is a PIECE OF CAKE!

You can also make advanced batch files to perform day-to-day tasks easily.

Video Credit: MUO

Do you like this “How to make a batch file” guide? Share your views with us.

Further Reading on HABytes: Check out Best Battery Optimizers for Windows 10 / How to capture a screen in Windows 10 / Save a Webpage as PDF on Desktop.

This article was originally published on Sept. 15, 2021

HA Staff
HA Staffhttps://thehabytes.com/
HA Staff is a team of writers that work together, researching new products everyday, buyer's guides, fact-checked, and daily life problem solving toturials.

Leave a Reply

Table Of Contents