Bat - batch files containing commands for automating certain actions in Windows. It can start one or several times depending on its content. The content of the "Batnik" user defines independently - in any case, it must be text commands that support DOS. In this article, we will consider creating such a file in different ways.
Creating a BAT file in Windows 10
In any version, Windows Windows can create batch files and use them to work with applications, documents or other data. Third-party programs are not needed for this, since Windows and itself provides all the possibilities for this.Be careful trying to create a BAT with an unknown and incomprehensible content for you. Such files can harm your PC, running the virus, extortioner or encrypter on the computer. If you do not understand which commands are the code, first find out their value.
Method 1: Notepad
Through the classic Notepad application, you can easily create and fill the BAT the necessary set of commands.
Option 1: Launch notepad
This option is the most common, so consider it first.
- Through the "Start", run the built-in Windows "Notepad".
- Enter the desired lines by checking their correctness.
- Click on "File"> "Save As".
- At first, select the directory where the file will be stored, in the "File Name" field, instead of an asterisk, enter the appropriate name, and the extension runs after the point, change the .txt to .bat. In the File Type field, select "All Files" and click "Save".
- If there are Russian letters in the text, the encoding when creating a file should be "ANSI". Otherwise, instead of them on the command prompt, you will receive a unreadable text.
- Batnik can be launched as a regular file. If in the content there are no commands that interact with the user, the command line will appear for a second. Otherwise, its window will start with questions or other actions requiring an answer from the user.
Option 2: Context menu
- You can also immediately open the directory where you plan to save the file, click on the empty location with the right mouse button, to "create" to "create" and select "Text Document" from the list.
- Specify it with the desired name and change the extension going after the point, with .txt on .bat.
- Bill may be a warning about changing the file expansion. Agree with him.
- Click on the PCM file and select Edit.
- The file will open in the notepad empty, and there you can fill it at your discretion.
- After completing, through the "Start"> "Save", make all changes. For the same purpose, you can use the CTRL + S key combination.
If you have NotePad ++ on your computer, it is better to use it. This application highlights syntax, allowing you to easily work with the creation of a set of commands. On the top panel there is an opportunity to choose an encoding with support for Cyrillic ("encoding"> "Cyrillic"> "OEM 866"), since the standard ANSI in some continues to display the cracks instead of normal letters entered on the Russian layout.
Method 2: Command String
Through the console without any problems, you can create an empty or filled Bat, which in the future through it will also be launched.
- Open the command line in any convenient way, for example, through the "Start", on the search for its name.
- Enter the COPY CON C: \ Lumpics_ru.Bat command, where Copy CON is a command that will create a text document, C: \ File Save Directory, Lumpics_RU - File Name, and .bat - Expansion of a text document.
- You will see that the flashing cursor moved to the line below - here you can enter text. You can save and empty file, and to learn how to do it, move to the next step. However, usually users immediately introduce the necessary commands there.
If you are manually inserted, go to each new line with a Ctrl + Enter key combination. If there is a pre-harvested and copied set of commands, simply click right-click on an empty place and what is in the exchange buffer will be inserted automatically.
- To save the file, use the Ctrl + Z key combination and press ENTER. Their pressing will appear in the console as shown in the screenshot below - this is normal. In the Batnik itself, these two characters will not appear.
- If everything has passed successfully, you will see a notification at the command prompt.
- To check the correctness of the created file, start it as any other executable file.
Do not forget that at any moment you can edit the batch file by clicking on them with the right mouse button and selecting "Edit" item, and press Ctrl + S.