Summary :

How to create a batch file

Batch files are used widely by computer handyman to simplify everyday tasks, to shorten the time and save unnecessary hassle. So what is a batch file? Can you create a batch file yourself? How to run the bat file on figurer? These questions volition be answered below.

Yous'd better turn to MiniTool Solution when you want to secure data or recover lost files from PC.

How to Create a Batch File Windows 10

What is batch file?

Batch file (besides known every bit bat file) is actually a special kind of text file with a .bat extension. You tin can put some commands into the batch file to turn a complex process into a elementary job. In this fashion, the commands tin be run in sequence every bit shortly as you click on the file. In short, the bat file is a script file in DOS, OS/2 and Microsoft Windows.

People are wondering how to create a batch file easily. Therefore, this part will focus on how to make a batch file in 2 ways.

How to Create a .bat File in Microsoft Windows 10

Firstly, you need to make sure you lot accept a text editor (Notepad or WordPad is ok) and some basic using noesis of Command Prompt. Then, follow the steps below.

How to make a bat file (simple bat file):

Stride ane. Correct click on the blank area on your PC screen.

Pace 2. Choose New from the bill of fare.

Step 3. Select Text Document from the submenu.

Step 4. Double click on the New Text Certificate file on desktop to open Notepad window.

Step 5. Blazon the following content into it:

@Echo OFF

Repeat Congratulations! Your showtime batch file executed successfully.

Intermission

Step half-dozen. Select File from card bar.

Step vii. Select the Save As… option.

Pace 8. Type a name into the textbox after File name (add .bat extension to it) and choose a location to relieve the simple batch file.

Pace nine. Click on the Save button to confirm.

Simple bat file

There's another way to open up the Notepad window:

  1. Click on the Cortana search icon/box on taskbar.
  2. Type notepad and select Notepad from the result.
Notepad

If y'all want to create an advanced Windows batch file or actionable batch file, you should also open the Notepad window -> blazon the corresponding content -> salvage it equally a bat file.

iv Ways To Recover Notepad File On Win 10 Rapidly!

How to Create a Bat File in MS-DOS

This fashion only works on the computers running a 32-scrap version of Windows. If your system is 64 fleck, please use the above steps.

Stride 1. Open up Windows search box and type cmd.

Step two. Select Control Prompt from the effect to open MS-DOS prompt.

Step 3. Type edit test.bat and hit Enter.

Pace 4. A blue edit screen will appear. Type the following content into it:

@echo off

echo Hello this a test batch file

pause

dir c:\windows

pause

Pace five. Find and click File.

Step 6. Cull leave from the carte du jour.

Step 7. Click on the Yes button to save information technology.

If you want to execute the test.bat file, but go back to the MS-DOS prompt -> type test -> hit Enter.

That's all about how to create.bat files.

How to Run a Batch File

Run in file explorer:

  1. Open File Explorer on your Windows 10.
  2. Navigate to the drive and folder that include the Windows batch file.
  3. Just double click on the batch file to run it.

Note: Some commands require the administrator privileges, and so you demand to run the .bat file equally ambassador: right click on the file -> choose Run as administrator -> click Yes.

Run Windows batch file in File Explorer

Click here if your File Explorer is not responding or has stopped working.

Run a batch file from Control Prompt:

  1. Open Windows search and type cmd.
  2. Right click on Command Prompt and choose Run as ambassador.
  3. Type C:\Users\folder location\filename.bat and hit Enter.
Run as administrator

In addition, yous can run a bat file in Windows ten on scheduled through Chore Scheduler or run the batch file on startup via file explorer.

The Command Prompt tool tin as well be used to recover files on Windows 10.