How To Create A File With A Bat Extension

Table of contents:

How To Create A File With A Bat Extension
How To Create A File With A Bat Extension

Video: How To Create A File With A Bat Extension

Video: How To Create A File With A Bat Extension
Video: How to Create a Batch (.bat) File in Windows 2024, April
Anonim

Batch files with the bat extension (batch) are plain text files that can be edited using any text editor, even Notepad. They are designed to handle special commands that can be used to access files and folders on your hard drive.

How to create a file with a bat extension
How to create a file with a bat extension

Necessary

Notepad software

Instructions

Step 1

When working with bat files, do not forget that when you create this file, you are specifying commands, the execution of which is similar to using the command line. In fact, this is so, after creating a simple file with one or two commands, you can see how the command line you probably already know is launched.

Step 2

To do this, launch Notepad. Click the "Start" menu and select "All Programs", go to the "Accessories" section and click on the search line. Also, the program can be launched after creating a new file, for example, on the desktop.

Step 3

After opening the program, add the following lines to the body of the file: @echo Test Bat file @ pause Now save this file, if you haven't already, press the keyboard shortcut Ctrl + S. In the dialog box that opens, in the File name field, enter 1.bat and click the "Save" button. Instead of the number "1", you can enter a completely different name, but with the condition that the bat extension is saved.

Step 4

Navigate to the folder where you saved the file and double-click on it with the left mouse button. You will see a command line window in which you will see the following lines: Test Bat file Press any key to continue …

Step 5

As you can see, you have used the Echo command, which displays the requested text. To compare the window of the bat file and the command line program, run the latter. To do this, press the Win + R key combination, enter the cmd command in an empty field and click OK. In the window that opens, enter the echo Test Bat file and pause commands one by one - the result will be the same.

Step 6

If you are interested in running a command, but you do not know how to do it, use the Help statement. To do this, right-click on the recently created file and click the "Change" button. Erase the contents of the bat file and enter the Help command, then press Ctrl + S (to save).

Step 7

After running the file, you will see a whole list of commands, one of which may be needed. To get help about a specific command, type the command help "command or process name" in the file being tested (the command or process is written without quotes).

Recommended: