Hello friends, Today I will tell you a method on how to create a Batch file in Windows 10. We have shared a step by guide to create any DOS Batch files on Windows PC/Laptop. Users can create file in format like .cmd, .bat, .btm. In just 5 easy steps you can have your Batch file in Windows 10.
What are the Batch Files in Windows PC/Laptop?
Basically, a batch file is a medium between you and CMD. Let us have a rough idea about CMD. Windows has a command line interpreter that is called Command Prompt. It takes the input from the user and processes them. A batch file (.bat, .cmd, .btm) is a file that consists of commands that are readable for the command prompt. When a user runs a batch file, then the code written in it is executed with the help of command line interpreter that is Command prompt. The set of command is called the batch script. A batch file can be made by machine automatically or by humans manually. You can also enable copy paste in command prompt.
How to Create a Ping Test Batch file in Windows 10
A ping test batch file is a file that is used to test the pinging of an IP address. This IP address can be of any server, website, etc. This ping test is done by a simple CMD ping command that is an external command of the Command Prompt. Ping command is used to send or receive the echo request from the server which is also known as Internet Control Message Protocol (ICMP). There is a quick way to create a ping test batch file in Windows 10 PC/laptop.
- Open the Notepad editor on your Windows 10 PC or laptop.
- Now, copy and paste the command: ping ipaddress >> C:\(path to the file) on the editor.
- Change the path of the file in place of within brackets C:\(path to the file).
- This command will ping to the targeted IP address and will save the result at your given path.
- Lastly, save it as the desired name with a .bat file format. For example; pingfile.bat
How to Create a Menu Selection Batch file in Windows 10
With the help of batch file functionality, we can create a simple menu selection batch file in our Windows 10 PC or laptop. What menu selection batch files are is that they contain a short menu of a list of different programs. There is a simple command offered by the command prompt which is a pre-built terminal of Windows operating system. If you want to create your menu selection batch file, then this is the perfect place for you my friend. Make sure you run system file checker to repair corrupted files.
- Open the simple Notepad editor on your Windows 10 PC/laptop.
- Simply, copy and paste the below shown command.
title Multiple Choice Menu
echo Select a task:
echo 1) Open www.mintywhite.com
echo 2) List Temp-files
echo 3) Run IpConfig.exe
echo 4) Run CleanUp.Bat
echo 5) Exit
set /p web=Type option:
if “%web%”==”1” start www.mintywhite.com
if “%web%”==”2” goto list
if “%web%”==”3” start ipconfig.exe
if “%web%”==”4” Call cleanup.bat
if “%web%”==”5” exit
echo Listing files from c:\windows\temp
dir c:\windows\temp /p /b
- Now, save the file as a .bat file for example, menu.bat file.
- That’s it. Your menu has been successfully created and will run smoothly.
How to Create a Batch File in Windows 10 – 100% Working
We have seen that what are batch files and what does it do even how does it work in the Windows operating system as well. This section will explain to you how to create a batch file in Windows 10. If you are running a Windows 10 Pc or Laptop, then you can use this guide to learn how to create a batch file in Windows 10. However, this method is an official method to run a batch file in Windows 10. However, if you are using another Windows operating system version such as 8, 8.1, 7 or even XP or 98, then you can use the same method to know that how to create a batch file in Windows 10. Without taking more time to let’s start the guide. Also, find Mac address on Windows 10.
- Go to the Start Menu on your Windows 10 PC/Laptop.
- Now, type notepad and search for it. Then, select it from the results.
- Once the Notepad application has been opened then copy and paste the code into it.
title My Test Batch File
:: See the title at the top. And this comment will not appear in the command prompt.
echo Test file executed.
echo I am too lazy to write commands again and again.
- Now, save it as the yourwishedname.bat file.
- After that, simply double click on it and you will see the code has been executed and the message has been displayed on the cmd.
Last Words on How to Create a Batch File in Windows 10 – 100% Working
In this manner, you can easily learn how to create a batch file in Windows 10. In this article, I have given my code to you guys which is very simple and easy it will only display a message on your command prompt screen. You can use more codes to make your batch file exciting and multifunctional. However, if you don’t want to code your batch file then you can download templates from the interest they are free to download and use as well. The saving and execution method has been explained to you so you can now use any batch file on your Windows 10 PC/Laptop. Share this with your relatives and friends so that they can also learn about how to create a batch file in Windows 10.