BAT files (Windows) commands. What is bat files and why they need

BAT files (Windows) commands. What is bat files and why they need
BAT files (Windows) commands. What is bat files and why they need

BAT file is a program code stored with extension.bat or.cmd to someone like.

BAT file capabilities are almost limitless, but usually programmers use these expansions in simple and routine affairs.

Using the BAT file, you can open files on your computer, copy to move and delete mask files and without, run third-party scripts, open the browser with the desired URL. I often use such files to open the FTP folder on a remote server.

How to create a bat file

Create Bat files easier than simple. Open the usual text editor and save it with extension.Bat.

You can also use the NotePad ++ advanced program.

Here is a sample code to write a BAT file:

explorer.exe "C: \\ Program Files"

This code will open the "Program Files" folder on a C: \\ disk

Writing.Bat (BAT) files requires a particular caution from the computer user. Since the batch files can delete entire directories, format the section of the computer

Here is an example code - formatting of the F: \\

@echo off
format F / Q / Autotest

Example BAT code - Create 100 folders:

@echo off
fOR / L %% I IN (1,1,100) DO MKDIR "DIR %% I"

make a BAT Ohm can also (virus) harmful program script: For example, the code below will delete important EXE files.

@echo off
do Del "C: \\ Windows \\ Exploer.exe"
do Del "C: \\ Windows \\ mspoint.exe"
do Del "C: \\ Windows \\ NotePad.exe"

Command Create folder BAT file

The code below will create 3 folders in the place where the file itself is located. Also, the first created folder will contain another attached folder. Since the folder names are written in Cyril, then you add the CHCP encoding string 1251. Such a file cannot be written in a regular notebook, as it is not possible to change the encoding of Russian letters. Use the NotePad ++ program.

cHCP 1251.
MD. \\ Folder_Article \\ Base \\
MD. \\ Directory \\
MD. \\ Storage \\

Download Bat File

- The file creates 3 folders

Sample BAT code as open folder

explorer.exe "C: \\ Users \\ Administrator \\ Desktop \\ photo \\"

Bat format how to open?

As well as creating files. Bat in a text editor, they can be opened with the same notebook, WordPad, or NotePad ++.

The only thing to remember when opening the BAT file is when you double-click on the file, it will start the program. Those to open it for editing, Mouse over to edit the file and right-click Open the context menu where choose Open with NotePad ++

Also, in the context menu, click on simply open you also start the BAT file execution.

There is another way: open the text editor notepad and drag your editable file to it.

Important: Users often confuse the concepts of files with the extension.Bat and the mail client "The Bat" for sending and receiving postal documents.

Basic BAT file statements

@ All executed BAT commands are displayed on the screen to remove unnecessary, the "dog" is put before the command. Often used with @echo off.
sET. Specifies variables. For example, SETPER \u003d C: \\ Windows Here PER assign the path. You can write a cumbersome value into the variable and specify it in the script, which will make the code compact. If its content changes, then you don't have to change the values \u200b\u200bwhere this variable is provided.
:: One of the two methods of commenting in the BAT file without outputting this string on the screen.
: Label When adding to the word colon, a label is created, which allows you to go to different partitions of the Batnik. The label can wear another name, Label is an example.
Call Bat command causing one batch file in another. All parameters described in one of the files can be transferred to each other.
Choice Selection team.
CLS. Clears the contents of the command interpreter, which is displayed above the CLS.
Echo. Displays a message to the screen. For example, "Echo How are you!" Will out "how are you!". If you do not use @echo OFF at the beginning of the batch file, then you will see the path to the BAT file and two messages, which is superfluous. You can create an empty string Enter ECHO. With a point at the end.
EXIT Completes the current batch script.
Goto Label Used to go to a specific label, in this case to Label and executes the script after it.
If As in the Batcomand programming languages, the condition is fulfilling the condition, depending on which the script will go on anyway. Syntax Meet the help.
for The cycle used to organize the implementation of the same actions.
Pause If you need to get acquainted with the result of the script, and it is performed, and the window quickly closes, then use Pause. It will help to see the result and complete the script by pressing any button.
REM. The second method of commenting. In contrast to :: printed on the screen, if there is no design @echo off.
Shift. Changes the position of batch parameters in the BAT file.
Start. Runs programs, windows, etc. It has many attributes.

For a more detailed description of the BAT file code, read the Windows Help

Windows BAT files are a convenient way to perform various tasks on a PC, which are actively using computer craftsmen. They allow you to automate everyday tasks, reduce the time of their execution and turn a complex process into something to meet an ordinary user. This article presents the basic capabilities of command files and recommendations on their independently writing them.

Automation is easy

How to create a bat-file? To do this, you need to perform the following actions:

  1. In any text editor, for example, in NotePad or WordPad, create a text document.
  2. Write your commands in it, starting with @echo, and then (each time in the new line) - title [name of the batch script], ECHO [Message that will be displayed on the screen] and PAUSE.
  3. Save text in an electronic document with extension.Bat (for example, test.bat).
  4. To start, double-click on the entirely created packet file.
  5. To edit it, you must click on it with the right mouse button and select Change item from the context menu.

The unprocessed file will look something like this:

title is your first BAT file script!

echo Welcome to the batch processing script!

In more detail about the commands of BAT files and their use, it will go below.

Step 1: Creating a software script

Suppose that the user often has problems with the network. It constantly uses the command line by typing ipconfig and pingown Google to troubleshoot network problems. After a while, the user understands that it would be much more efficient if he wrote a simple BAT file, recorded it on his USB drive and launched it on computers that it diagnoses.

Creating a new text document

A batch file simplifies execution on a computer repetitive tasks using the Windows command line. Below is an example of a script that is responsible for displaying some text on the screen. Before creating a BAT file, right-click on an empty location in the directory and select the "Create" item and then "Text Document".

Adding Code.

Double-click on this new text document will open the default text editor. You can copy and insert the above code example into a text record.

Preservation

The above script displays the text "Welcome to the batch processing script!". The electronic document must be recorded by selecting the File text editor menu item, "save as", and then specify the desired BAT file name. It should be completed with extension.Bat (for example, Welcome.Bat) and click "OK". To properly display, Cyrillic in some cases should be made in the correct selection of encoding. For example, when using the console of the Russified Windows NT system, the document must be saved in CP866. Now you should double-click on the BAT file label to activate it.

But the screen will appear inscription:

"Welcome to the batch processing script! To continue, press any key ..."

If the BAT file does not start, users recommend entering the register and delete the key:

"HKEY_CURRENT_USER \\ SOFTWARE \\ Microsoft \\ Windows \\ Currentversion \\ Explorer \\ FileExts \\ .bat \\ userchoice".

Do not think that it's all that the batch processing scenarios are capable. The script parameters are the modified versions of command line commands, so the user is limited only by their capabilities. And they are quite extensive.

Step 2: Acquaintance with some teams

If the PC user is familiar with how to execute the DOS console commands, it will be a master script creation master, because it is the same language. Lines in bat-files will communicate the interpreter cmd.exe all that is required of it. It saves time and strength. In addition, it is possible to set some logic (for example, simple cycles, conventional regulations, etc., which are conceptually similar to procedural programming).

Built-in teams

1. @echo is a BAT file command that will allow you to see the work of the script on the command line. It is used to view the progress of the working code. If a batch file has any problems, this command will allow you to quickly localize problems. Adding OFF allows you to quickly complete the execution of the code, avoiding the output of unnecessary information on the screen.

2. Title provides the same features as the tag In HTML, i.e. creates a header for a batch script in the command line window.</p><p>3. Call calls one BAT file from another or subroutine inside one scenario. For example, the POWER function calculates the degree% 2 of the number% 1:</p><p>iF% Counter% GTR 1 (</p><p>sET / A Counter- \u003d 1</p><p>endlocal & Set Result \u003d% Prod%</p><p><img src='https://i0.wp.com/syl.ru/misc/i/ai/324915/1862019.jpg' width="100%" loading=lazy loading=lazy></p><p>4. CLS clears the command line. It is used to prevent the previous outline output code to view the running of the current script.</p><p>5. Color sets the color of the font and background. For example, Color F9 team sets white letters on a blue background. The command without parameter restores the default settings.</p><p>6. Echo serves to output information, as well as inclusion (ECHO ON) or shutdown (ECHO OFF) of this output. For example, the echo command. Displays a new string without a point, and Echo. - point. Without parameters, the command displays information about your current status - Echo O or ECHO OFF.</p><p>7. REM provides the same functionality as the tag<! в HTML. Такая строка не является частью выполняемого кода. Вместо этого она служит для пояснения и предоставления информации о нем.</p><p>8. PAUSE allows you to interrupt the execution of the BAT file commands. This makes it possible to read the executed lines before continuing the program. At the same time, the message "To continue, press any key ...".</p><p>9. SET allows you to view or install environment variables. With the / P key, the command requests the user input and saves it. With the parameter / and it makes it possible to perform simple arithmetic operations, also assigning them to the result of the variable. During operations with rows, there should be no gaps or after the sign of equality. For example, the SET command displays a list of environment variables, Set Home - the values \u200b\u200bof the arguments starting with "Home", and SET / P INPUT \u003d Enter a whole: requests the input of an integer and assigns it to the corresponding variable.</p><p>10. Start "" [Website] will launch a specified website in a web browser used by default.</p><p>11. If it serves to verify a certain condition. If it is true, then the following command is performed. Conditions are 3 species:</p><ul><li>ErrorLevel Number - Checking the completion code of the last manual for compliance or excess of the specified number. At the same time, 0 denotes a successful task execution, and any other number, usually positive, reports an error. For example, you can use nested commands to accurately define the completion code: IF ErrorLevel 3 IF NOT ErrorLel 4 Echo error No. 3 occurred.</li><li>String1 \u003d\u003d String2 - Checking the match of two lines. For example, in the absence of an external parameter, the IF command "% 1" \u003d \u003d "" Goto Error will transmit the control of the error mark.</li><li>EXIST Name - Checking the existence of a file with the specified name. For example, If Not Exist A: \\ Program.exe Copy C: \\ Projects \\ Program.exe A: Copies the program program.exe to the disk A, if it is not there.</li> </ul><p>12. ELSE should be in one line with the IF command. Indicates the need to execute the following instruction if the expression is false.</p><p><img src='https://i0.wp.com/syl.ru/misc/i/ai/324915/1862021.jpg' width="100%" loading=lazy loading=lazy></p><p>13. For Used to repeat certain actions with each member of the list. It has format for %% argument in (list) DO command. The argument can be any letter from A to Z. The list is a sequence of strings separated by spaces or commas. Distribution signs can also be used. For example:</p><ul><li>for %% D IN (A, C, D) DO DIR %% D - sequentially displays the directories of the disks A, C and D;</li><li>for %% f in (* .txt * .bat * .doc) Do Type %% F - prints the contents of all.txt-, .bat- and.doc files in the current directory;</li><li>for %% P in (% PATH%) DO IF EXIST %% P \\ *. Bat Copy %% P \\ *. BAT C: \\ WAT - copies all batch files that exist in all directories of the search route to the folder C: \\ 14. The colon (:) before the word forms a link from it, which allows you to skip part of the program code or go back. Used with Call and Goto commands, pointing, from what place to continue the execution of the BAT file, for example, when performing a specific condition:</li> </ul><p>15. Variables:</p><p>%% a denotes each file in the folder;</p><ul><li>% CD% - current directory;</li><li>% DATE% - system date, the format of which depends on localization;</li><li>% Time% - system time in the form of CC: mm: ss.m.;</li><li>% Random% - generated pseudo-random number in the range from 0 to 32767;</li><li>% Errorlevel% is the completion code returned by the last command or BAT script.</li><li>Extract part of the string, which is contained in a variable, with its position known and the length you can:</li> </ul><p>% [variable]: ~ [Start], [Length]%. For example, show a date in DD / MM / GGG format as a GGGG-MM-DD, so: Echo% Date: ~ 6.4% -% Date: ~ 3.2% -% Date: ~ 0.2%.</p><p>16. (". \\") - root folder. When working with the console before changing the name of the file, it is removed, etc. You must direct the action of the command to a specific directory. When using a batch file, it is enough to start it in any desired directory.</p><p>17.% The number - takes the values \u200b\u200bof the parameters transmitted by the user in the BAT file. Can be separated by spaces, commas or colon. "Digit" is a number from 0 to 9. For example,% 0 accepts the value of the current command. % 1 corresponds to the first parameter, etc.</p><p>{!LANG-64581d7ae19bf528ad83b2faef55c27d!}</p><p>18. SHIFT - the command used to shift the input parameters to one position. It is applied when external arguments are transmitted to the packet file. For example, the next BAT file copies to the D disk files specified as parameters on the command line:</p><p>iF NOT (% 1) \u003d\u003d () Goto Next</p><p>In addition, the following manipulations can be made with arguments:</p><ul><li>% ~ - remove the surrounding quotes;</li><li>% ~ F - Expand the parameter to the full path name along with the name of the disk;</li><li>% ~ D - show the name of the disk;</li><li>% ~ P - Display only the path;</li><li>% ~ N - Select only the file name from the parameter;</li><li>% ~ x - leave only the extension;</li><li>% ~ s - convert the path to the view with short names;</li><li>% ~ A - Extract file attributes;</li><li>% ~ T - display the date and time of creation;</li><li>% ~ z - Display the file size;</li><li>% ~ $ PATH: - Produces a search in the directories listed in the PATH environment variable and expands the parameter to the first found corresponding full name or gives an empty string in case of failure.</li> </ul><p><img src='https://i2.wp.com/syl.ru/misc/i/ai/324915/1862020.jpg' width="100%" loading=lazy loading=lazy></p><h2>Wildcard signs</h2><p>Many commands accept file name templates - signs that allow you to establish a matching group of file names. Related signs include:</p><ul><li>* (asterisk) - denotes any sequence of characters;</li><li>? (Question mark) - replaces one (or 0) sign other than the point (.).</li> </ul><p>For example, the dir * .txt command displays a list of TXT files, and DIR ???. TXT is a list of text documents whose length does not exceed 3 letters.</p><h2>Functions</h2><p>Like subroutines, they are emulated using the Call, SetLocal, Endlocal commands and tags. The following example demonstrates the ability to determine the variable in which the result is saved in the call string:</p><p>call: Say Result \u003d WORLD</p><p><img src='https://i1.wp.com/syl.ru/misc/i/ai/324915/1862022.jpg' width="100%" loading=lazy loading=lazy></p><h2>Calculations</h2><p>In BAT files, you can perform simple arithmetic operations with integer 32-bit numbers and bits using the SET / A command. The maximum supported number is 2 ^ 31-1 \u003d 2147483647, and the minimum - - (2 ^ 31) \u003d -2147483648. Syntax resembles C programming language. The arithmetic operators include: *, /,%, +, -. In the bat-file% (the residue of integer division) should be entered as "%%".</p><p>Operators with binary numbers interpret the number as a 32-bit sequence. These include: ~ (not or addition), & (s), | (Or), ^ (excluding or),<< (сдвиг влево), >\u003e (shift to the right). The logical negation operator is! (Exclamation point). It changes 0 in 1 and a non-zero value to 0. The combination operator is (comma), which allows you to produce a larger number of operations in the same SET command. Combined assignment operators + \u003d and - \u003d in expressions A + \u003d B and A- \u003d and correspond to the expressions a \u003d a + b and a \u003d a-b. * \u003d,% \u003d, / \u003d, Δ, | \u003d, ^ \u003d, \u003e\u003e \u003d,<<=. Приоритет операторов следующий:</p><p>(); %+-*/; >>, <<; &; ^; |; =, %=, *=, /=, +=, -=, &=, ^=, |=, <<=, >>=; ,</p><p>Literals can be administered in the form of decimal, hexadecimal (with leading 0x) and octal numbers (with leading zero). For example, SET / A N1 \u003d 0xFFFF assigns the N1 hexadecimal value.</p><h2>External teams</h2><ul><li>EXIT is used to exit the DOS console or (with option / b) only the current BAT file or subroutine.</li><li>IPConfig is a classic console command that displays network information. It includes MAC and IP addresses, and subnet masks.</li><li>Ping pings an IP address by sending data packets to it to evaluate its remoteness and waiting time (response). Also used to set a pause. For example, the Ping 127.0.01 -N 6 command suspends the execution of code to 5 s.</li> </ul><p>The BAT file library is enormous. Fortunately, there are many pages in the network in which they are all listed, along with the variable batch script.</p><p><img src='https://i1.wp.com/syl.ru/misc/i/ai/324915/1862017.jpg' width="100%" loading=lazy loading=lazy></p><h2>Step 3: Record and Start Bat File</h2><p>The next script will simplify daily online activity. What if there is a desire to instantly open all your favorite news sites? Since scripts use console commands, you can create a script that opens each news feed in one browser window.</p><p>Next, you should repeat the process of creating a BAT file, starting from an empty text document. To do this, right-click on an empty place in any folder and select "Create", and then "Text Document". After opening the file, you must enter the following script that runs the main Russian-speaking media available on the Internet:</p><p>start "" http://fb.ru</p><p>start "" http://www.novayagazeta.ru</p><p>start "" http://echo.msk.ru</p><p>start "" http://www.kommersant.ru</p><p>start "" http://www.ng.ru</p><p>start "" http://meduza.io</p><p>start "" https://news.google.com/news/?ned\u003den_ru&hl\u003dru</p><p>This script contains the Start commands "" that open several tabs. You can replace the proposed links by any other to choose from. After entering the script, go to the "File" editor menu, and then to "save as ..." and write a document with extension.Bat by changing the "File Type" parameter to "All Files" (*. *).</p><p>After saving to start the script, you can double-click on it. Web pages will instantly start booting. If you wish, you can place this file on your desktop. This will allow you to get instant access to all your favorite sites.</p><h2>Organizer</h2><p>If you download several files per day, then in a short time in the "Download" folder there will be hundreds of them. You can create a script that orders them by type. It is enough to place .Bat file with a program in a folder with inorganized data and double-click to start:</p><p>rEM each file in the folder</p><p>for %% a in (". \\ *") Do (</p><p>rEM Check for expansion and non-utility to this script</p><p>iF "%% ~ XA" NEQ "" IF "%% ~ DPXA" NEQ "% ~ DPX0" (</p><p>rem Check for a folder for each expansion, and if not, then create</p><p>iF Not Exist "%% ~ XA" MKDIR "%% ~ XA"</p><p>rem Move the file to the folder</p><p>mOVE "%% A" %% ~ DPA %% ~ XA \\ "</p><p>As a result, the files in the download directory are sorted by folders whose names correspond to their expansion. It is so simple. This batch script works with any data type, whether document, video or audio. Even if the PC does not support them, the script will still create a folder with the corresponding label. If there is already a JPG or PNG directory, the program will simply move the files to this expansion.</p><p>This is a simple demonstration of what batch scripts are capable of. If some simple task must be performed again and again, be it an ordering of files, opening multiple web pages, mass rename or creation of copies of important documents, a batch script will help to fulfill tedious work for a couple of clicks.</p> <p>A packet (BAT) file is a file type that supports text having an extension .Bat, and includes the construction operators for the cmd.exe command line.</p> <p>This type of file is a useful tool for automating monotonous file operations - copying, deletion, etc., as well as starting various applications and perform other operations in the OS.</p> <p>For example, if you need to run the iPConfig / Flushdns DOS, cleansing the DNS sensor cache, it can be done via the cmd.exe launch. However, if the procedure needs to repeat repeatedly, it is better to do this through the launch of the pre-created BAT file.</p> <p>When creating a BAT file, you may need to turn on display file extensions. For this:</p> <br><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Nazhimaem-myshju-pravoj-na-knopke-Pusk-i-vybiraem-Panel-upravlenija-.jpg' width="100%" loading=lazy loading=lazy><p>For this:</p> <ol><li>Open the "Notepad" by typing in the taskbar search bar (Loupe map at the bottom of the left) word Notepad and clicking on the pop-up icon. <p><img src='https://i2.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Otkryvaem-Bloknot--e1531379677985.jpg' width="100%" loading=lazy loading=lazy></p></li> <li>Writing in the IPConfig / Flushdns and Pause team notepad. <p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Vpisyvaem-v-bloknote-komandy.jpg' width="100%" loading=lazy loading=lazy></p> <blockquote><p><i><b>Reference!</b> Using the PAUSE operator does not allow the DOS screen to close after the BAT file execution so that the user has the ability to see the CMD interpreter response.</i></p> </blockquote></li> <li>In the notepad window, click the file "File" - "Save As". <p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Vybiraem-Sohranit-kak-.jpg' width="100%" loading=lazy loading=lazy></p></li> <li>In the Save how to click on the left, where to place the file, write the name of the file being created and specify the extension .Bat (via the point) (1) by selecting the "File Type" - "All Files" (2). Then click "Save" (3). <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/V-okne-Sohranit-kak-nazhimaem-sleva-kuda-pomestit-fajl-pishem-imja-sozdavaemogo-fajla-i-ukazyvaem-rasshirenie-.bat-vybrav-v-Tip-fajla-Vse-fajly-.-Zatem-nazhimaem-Sohranit-.png' width="100%" loading=lazy loading=lazy></p></li> <li>Click twice with the saved file. In some situations, it may be necessary to start the BAT under the name of the administrator. To do this, click on it with the mouse (right), and select "Run on the name of the administrator".</li> </ol><p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Klikaem-dvazhdy-myshju-na-sohranennom-fajle.jpg' width="100%" loading=lazy loading=lazy></p> <p>The result of the BAT file is displayed in the DOS window.</p> <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Rezultat-ispolnenija-bat-fajla.jpg' width="100%" loading=lazy loading=lazy></p> <p>In this case, the contents of the DNS name permissions service cache are successfully cleared by correcting the problems of displaying Internet pages and other DNS problems. The system is proposed to click any key to close the window.</p> <blockquote> <p><i>If you want to know more about, as well as consider the instructions for creating, you can read an article about it on our portal.</i></p> </blockquote> <h2><span>Basic BAT file statements:</span></h2> <ul><li>ECHO: Displays the text in the DOS window;</li> <li>Echo Off: Cancels the display of command text in a DOS window, showing the prompt and the result performed;</li> <li>@Echo OFF: cancels the display of command text and prompts, showing the result;</li> <li>Xcopy: Used to copy directories and files with extension parameters;</li> <li>Start: Starts executable.exe executable with its standard application, opens directory;</li> <li>FOR / IN / DO: Used to specify files;</li> <li>MKDir: Creates directories;</li> <li>REM: To enter a comment string in the program;</li> <li>RMDIR: To remove directories;</li> <li>Del: To delete files;</li> <li>Copy: to copy files;</li> <li>Title: Editing window title.</li> </ul><p>The use of some of the listed commands is shown in the example below. It should be noted that the @echo OFF command hides the path of the executable command displayed by the CMD on the DOS screen.</p> <p><img src='https://i2.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Komanda-echo-off-skryvaet-put-vypolnjaemoj-komandy.jpg' width="100%" loading=lazy loading=lazy></p> <p>Starting programs in the BAT file occurs using the START command and specify the name of the program running.</p> <p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Zapusk-programm-v-fajle-bat-proishodit-s-pomoshhju-komandy-start.jpg' width="100%" loading=lazy loading=lazy></p> <p>Also in the file can be registered the full path to the executable file.</p> <p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/V-fajle-propisan-polnyj-put-do-ispolnjaemogo-fajla.jpg' width="100%" loading=lazy loading=lazy></p> <p>Both of these entries for Firefox work correctly. However, they are both correct only for Windows registered applications. If you try to start a portable program (for example, FileZilla) without recording the entire path to the started file, it will not start.</p> <h2><span>Long names in bat-files</span></h2> <p>Sometimes in Bat there are programs that do not work with long names with spaces - usually these are some old programs for MS-DOS. In these cases, the use of short dos names without spaces, as well as quotes, helps.</p> <p>Rules for recording short DOS names (format 8.3): The six initial characters of the folder name character are activated, without considering the spaces, then its number is indicated in order through ~. For example: Start C: Program Filesmozilla FirefoxFirefox.exe is converted to: Start C: Prograpra ~ 1mozill ~ 1Firefox.exe.</p> <p>A situation is possible when there are several folders with the same symbols in the title.</p> <p><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/V-odnom-kataloge-imejutsja-neskolko-papok-s-odinakovymi-simvolami-v-nazvanii-e1531381521905.png' width="100%" loading=lazy loading=lazy></p> <p>Their short names in this case should be numbered in accordance with the alphabetic order of the folders:</p> <ul><li>Mozill ~ 1;</li> <li>Mozill ~ 2;</li> <li>Mozill ~ 3.</li> </ul><p>However, if Mozilla Firefox is removed from the computer, the following will not work for Mozill ~ 1 records. Therefore, short DOS names are not the best solution to solve long names. Creating this type name on NTFS is also disabled in the Windows registry.</p> <p>To solve the problem of long name names, the recording can also be enclosed in quotes. Quotes "", located before being prescribed by the triggered file, are a mandatory attribute that includes any heading or only quotes.</p> <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Kavychki-raspolagajushhiesja-pered-propisyvaemym-putem-k-zapuskaemomu-fajlu-javljajutsja-objazatelnym-atributom.jpg' width="100%" loading=lazy loading=lazy></p> <p>However, in some cases, quotes do not work at all. In this case, it is possible to use the CHDIR (CD) working directory (CD). Start Firefox.exe is recorded in this case the next working look.</p> <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Zapis-start-firefox.exe-priobretaet-rabochij-vid.jpg' width="100%" loading=lazy loading=lazy></p> <p><b>Reference. The CD command is perhaps the only universal solution to the issue of long names in BAT files.</b></p> <h2></h2> <p>You can not only run programs in the BAT file, but also to set them the options (keys) of the launch. For example, if you run a BAT file with a record: start /?, It will display a list of keys using the necessary explanations on the DOS screen.</p> <p><img src='https://i2.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Zapusk-programm-v-bat-fajlah-s-kljuchami.jpg' width="100%" loading=lazy loading=lazy></p> <p>An example of the keys used, where: - Minimize is the key to minimize the program after it starts, - Hide_SPLASH is the key for folding the program in Tray.</p> <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Primer-ispolzuemyh-kljuchej.jpg' width="100%" loading=lazy loading=lazy></p> <blockquote> <p><i><b>Reference!</b>All related to the launched files.exe is recorded with them in the BAT file in a common line.</i></p> </blockquote> <p>The folder creation command is performed in BAT using the MKDIR operator (MD). If you run the BAT file given in the example, it will create four invested folders on the C. disc</p> <p><img src='https://i2.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Komanda-sozdanija-papki-vypolnjaetsja-v-bat-s-pomoshhju-operatora-MKDIR.jpg' width="100%" loading=lazy loading=lazy></p> <p>The following example is how to open not one, but at once several catalogs on the disk of S.</p> <p><img src='https://i1.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Komanda-dlja-otkrytija-neskolkih-katalogov-na-diske-S.jpg' width="100%" loading=lazy loading=lazy></p> <h2></h2> <p>The example below shows how to copy the folder from the disk D: to disk E. The parameter / s allows you to copy directories and subdirectories. Parameter i / creates a new directory so that the XCOPY command copies files into it.</p> <p>The base file at the same time as it remains both on Disk D, and is copied to a new location specified in the BAT file.</p> <h2><span>Editing Bat.</span></h2> <br><img src='https://i0.wp.com/pc-consultant.ru/wp-content/uploads/2018/07/Pri-pomoshhi-klika-PKM-vybiraem-punkt-Izmenit--e1531384291269.jpg' width="100%" loading=lazy loading=lazy><h3><span>Editing programs</span></h3> <p>An ordinary user for interacting with BAT files may be enough for a simple "notebook" functionality, but, for example, the system administrator needs the editor to be more powerful. You can work with Bat in any editors of texts aimed at interacting with the code, in particular, in "Notepad ++" or "NotePad2".</p> <p>From the specialized software, you can mark the Dr.Batcher utility specifically designed to create a BAT, and includes a visual editor, highlighted syntax, bookmarks, special commands and numbering of pages.</p> <h3><span>Video - How to create a BAT file in Windows 10</span></h3> <p><span class="xNOKAR6jcgQ"></span></p> <p>Greetings! Today I decided to tell you about Bat files, or batchie, as they are called in a simple way. I assume that the use of BAT files will be useful for each computer user, expand the possibilities and simplify the implementation of many tasks.</p> <h2>What is Bat and why do you need it?</h2> <p>BAT is a file extension (BAT). Surely, many users know that each file has its own extension. This is the last line after the point in the title. It is this "tail" you need to determine the system as music, video, image or any other. You can even experiment. Take any picture and rename along with the extension. Windov will immediately notify that you change the extension, and the file may not be determined by the system. Agree with the query and see that your picture is no longer displayed as an image. If you rename as before, everything will be restored again. If you are not visible extensions, you need to activate this feature in the conductor, in the View tab.</p> <p>For Windows Bat is a file with instructions for certain actions that are laid in the Bat file itself. An empty BAT format file will start, but no action is performed, will not. Batnik is a set of instructions for Windows console.</p> <h2>How to create a BAT file to start the program?</h2> <p>To create a batch file, you need to start the text editor, then save the file with the BAT endpoint. In the absence of in your editor there is no save function with such an extension, it must be prescribed independently. When you start such a file, we will open the console and if there are no commands, it will immediately cling.</p> <p>Now let's task the command to start the program. To do this, you need to open our created batch file in a notebook or other editor and register the team.</p> <p><img src='https://i1.wp.com/softo-mir.ru/wp-content/uploads/2017/03/2-8.jpg' align="center" width="100%" loading=lazy loading=lazy></p> <p>On the example, start the browser. You must first enter the Start command and after the spacebar to write Opera.</p> <p>It should look like this:</p> <p><b>Start Opera.</b></p> <p><img src='https://i1.wp.com/softo-mir.ru/wp-content/uploads/2017/03/3-5.jpg' align="center" width="100%" loading=lazy loading=lazy></p> <p>Such will work for the programs of the well-known system, but if you run the softe, which is not known to the system, you will need to register the entire path to the program. For example, if you have FTP installed in the Program Files folder, then to start it to enter the command</p> <p><b>start Filezilla.</b></p> <p>And if the FTP client is set to another folder, you will need to register all the way.</p> <p><img src='https://i0.wp.com/softo-mir.ru/wp-content/uploads/2017/03/4-3.jpg' align="center" width="100%" loading=lazy loading=lazy></p> <p>The scope of batch features is quite wide. You can prescribe a variety of commands to the configuration. You can find them on the Internet if you are interested in more detailed information on teams Write in the comments I will try to answer you. Similarly, VBS works. This is the same, only the execution of commands is not through the console, and the commands are somewhat different.</p> <p>This technology will help when performing different types of tasks, and in automatic mode. Some users even write viruses thus. To impossible to change the file configuration using the text editor, you must convert the BAT file to the EXE. This will help make a different auxiliary software that you can find on the network. For example, the Bat to Exe Converter program will help to convert BAT in EXE.</p> <p>The BAT function is very useful and sometimes necessary. Using it, you can write entire programs of the narrow spectrum of action. The scope depends only on the knowledge of the commands and the ability to combine them. Therefore, use and expand your skills and skills to use the computer at the super user level.</p> <p>Users who often work with the Windows command line and periodically perform the same type, use the script or BAT files in their operation. Of course, it is necessary to at least superficially know the command line commands and the syntax of their writing. Speaking about the command line, many do not even represent how wide the opportunities it possesses, and when using BAT files, users can also be significantly expanded.</p> <h3></h3><p>What are BAT files?</p> <p>Bat-files or "Batniki" are called so due to their permission (BAT). BAT-FALS This is essentially text files that contain from one to several lines of the command line code. Starting BAT files is performed by a simple double click on it. The commands recorded in it will be executed sequentially, the command line window will appear. After completing the command prompt command, the command line closes. You will notice the MOGS, how such files work when installing games and applications. In such windows, it is very often unpacking the archives of a large compression ratio with the display of the percentage of unpacking. If the "batch file" contains only a few simple commands, the command line window may appear only to several milliseconds and disappear from the screen.</p> <p>If you need to enter a user of information or confirmation of the execution of the command line window, does not disappear, and the execution process of commands is paused before entering the user's appropriate data.</p> <p>Batnik, like any other executable file, can be added to autoload or used in the task scheduler, which significantly expands its capabilities and scope.</p> <h3></h3><p>How to create BAT files?</p> <p>Suppose you need to create a "batch file" that will run certain programs in a given sequence. At the same time, in order not to create multiple shortcuts on the desktop and run each of them with the mouse, it is convenient to create one single bat-file and run it, and it will in turn launch all those applications. <br> To create a BAT file you will need a simple text editor, traditionally in the Windows system use notepad. Run the text editor and enter several lines to it that match the command line command syntax.</p> <p><b>For example, to launch applications:</b></p> <p><b>start Explore.</b> <br><b>start Calc.</b> <br><b>start Iexplore.</b> </p> <p>After that, save this file on the desktop with a name for you, for example, "Launch Prog". The extension of the saved file is to be changed from TXT to BAT. If you do not displays the file expansion, you must enable file extensions display. You can make it in the settings of the folder parameters through the control panel or in the conductor itself. After you change the extension, make a trial launch of the saved file. When performing the above example, the three programs immediately launch: Explorer, Calculator and Internet Explore.</p> <p><img src='https://i1.wp.com/comphelpmoscow.ru/wp-content/uploads/2015/11/bat-%D1%84%D0%B0%D0%B9%D0%BB%D1%8B_001.png' align="center" width="100%" loading=lazy loading=lazy></p> <p>This is the easiest example that can be done with the "Batnik". In most cases, much more complex scenarios are used not only to launch applications, but also to perform system settings and programs and many other things.</p> <p>During testing the work of your "Batnik", you may encounter errors in the work or some command will not be executed, but to see at what stage an error occurred is, you need to make the command execution window not disappear. This can be done very simple. At the end of your code, insert the Pause string. The execution of this command will allow the user to see the command line window even after completing all the commands. It is possible to scroll through the sequence of executable commands and messages of the program if errors appear in the execution of one of the command. Pressing any key leads to the command line window will be closed. Finding an error in the syntax, you can fix it and then delete the PAUSE line from the BAT file and check the finally stability of the response of your BAT file.</p> <script>document.write("<img style='display:none;' src='//counter.yadro.ru/hit;artfast_after?t44.1;r"+ escape(document.referrer)+((typeof(screen)=="undefined")?"": ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth? screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+";h"+escape(document.title.substring(0,150))+ ";"+Math.random()+ "border='0' width='1' height='1' loading=lazy loading=lazy>");</script> </div> </div> </div> </div> </div> <div class="right-rail-pseudo"></div> <aside class="right-rail collection-sidebar"> </aside> </div> <div id="wide-collection-items-container"></div> <div class="module-more-news-center"> </div> <div class="collection-footer grid"> <aside class="right-rail collection-sidebar"></aside> <div class="collection-footer-container"> <footer class="content-foot"> <aside class="module-social-sharing"> </aside> <div class="content-topics"> </div> </footer> </div> </div> </article> </main> <footer class="footer"> <nav> <ul class="nav"> <li>Women's world. Pregnancy and childbirth. Educational games 2021.</li> <li><a class="tracked-offpage" data-track-category="Footer" data-track-action="Go to Privacy Policy" href="">Privacy Policy</a></li> <li><a class="tracked-offpage" data-track-category="Footer" data-track-action="Go to Contact Us" href="">Contacts</a></li> <li><a class="tracked-offpage" data-track-category="Footer" data-track-action="Go to Media Kit" href="">Advertising on the website</a></li> <li><a class="tracked-offpage" data-track-category="Footer" data-track-action="Go to Sitemap" href="">site `s map</a></li> </ul> </nav> </footer> <div id="lightbox" class="lightbox"> <div class="lightbox-close"></div> </div> <script src="/assets/cookie.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <script> window.jQuery || document.write(' < script src = "/assets/jquery.min.js" > < \/script>') </script> <script src="/assets/nunjucks-slim.js"></script> <script src="/assets/main.min.2679f7f2caa5ae23.js"></script> <div class="ad-container out-of-page-ad" id="one-by-one-0" data-ad-param="0" data-type="3" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="four-by-four-0" data-ad-param="0" data-type="5" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="oop-0" data-ad-param="0" data-type="6" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="skin" data-ad-param="0" data-type="6" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="sharethrough-1" data-ad-param="0" data-type="6" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="sharethrough-2" data-ad-param="0" data-type="6" data-pos="0" data-ad-rendered="true"></div> <div class="ad-container out-of-page-ad" id="yieldmo" data-ad-param="0" data-type="6" data-pos="0" data-ad-rendered="true"></div> </body> </html><script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script>