How to create a notepad with bat extension. Creating a file with the BAT extension. Creating a bat file in Dr. Batcher

BAT file is a DOS batch file that executes commands using the command Windows strings called "cmd.exe". BAT file extension is a common text file which was saved with the .bat extension. V operating systems MS Dos and Windows given type file is recognized as a batch file. Thus, the BAT file format adopts a scripting programming language and acts like a batch file.

The BAT format stores certain linear commands. The use of the BAT file is common when running various programs, and these batch files may be necessary to control the utilities responsible for maintenance. Windows systems.

You can create BAT manually, in addition, the user has the ability to independently edit bAT files in order to automate certain tasks along with re-performing some operations. You can create a BAT file in a standard text editor; you just need to keep the BAT extension.

If the user is faced with the presence of such file extensions in his computer, downloaded from third-party resources, it is recommended that they be scanned by an antivirus complex beforehand, because an unknown Batch File may also contain a virus threat.

Even nowadays, the BAT format is considered to be very common among system administrators, because the .bat file allows you to perform the assigned tasks quite quickly and comfortably. In OS Windows files BAT is used to perform operations related to moving, copying and deleting certain files and directories.

People who are familiar with the term batch file know that BAT files can significantly simplify their lives and save time if they know how to write and use them correctly. In this article, I will talk about how to create BAT files and introduce you to the common mistakes that usually occur when writing them.

It is very easy to create a BAT file. It is enough to open notepad and save a blank sheet with the .bat extension by selecting the Save as ... option and writing something ending in .bat in the File name field, for example test.bat.
Specify the file type as in the screenshot below - All files. Save and receive the BAT file.

You can edit the BAT file in notepad or any other text editor focused on working with code.

Now let's go directly to practical information... On the net, many are looking for an answer to the question How to deal with spaces in BAT files? ... The presence of a space in the paths to folders and executable files causes an error. The most common answer is: Enclose the path in quotation marks. And this answer is not correct. True, some will argue with foaming at the mouth that it works. So, there were two why - why is not true and why some will.

On Windows (as well as on UNIX), programs installed on the system are properly registered by the system. Therefore, some of installed programs can be launched with one simple command from a BAT file or from the Run applet of the Start panel. One of these programs is Firefox:

start firefox

If after this command you write the path to the executable file, the following happens: Firefox starts and tries to process the request, that is, the file, the path to which is specified. That is, if you specify the following:

start firefox C: \ Program Files \ Mozilla Firefox \ firefox.exe

The browser will open so it doesn't write after start firefox. That is why some comrades will assure that everything works great. However, if you take a portable program, the situation is completely different. Consider as an example Filezilla ftp client... Since the system is unaware of the program, the above line is

start filezilla

will not work. To run a program unknown to the system, you must specify the path to it:

start D: \ FileZilla \ FileZilla.exe

Long names in bat files

Now let's talk about paths and spaces. The first way to avoid this problem is to use a short name.

start C: \ Program Files \ Sound Club \ scw.exe

In the example, there are two names with spaces. Let's replace them with short ones. The rules for creating short names are as follows: the short name uses the first six characters of the name without regard to spaces, after the name indicate the ordinal number of the folder using the symbol ~ ... Since the Program Files and Sound Club folders are in the singular, the following will turn out:

Program Files - Progra ~ 1 Sound Club - SoundC ~ 1 start C: \ Progra ~ 1 \ SoundC ~ 1 \ scw.exe

If there are two folders nearby, for example Sound Club and Sound Clown, then following the rules, in the example above, you will need to specify SoundC ~ 2, since in this case Sound Club will be the second name (names are considered in alphabetical order).

But this method is inconvenient in that you have to specify serial numbers. The situation with Program files is less normal. Few people have two similar folders on system disk... But if you decide to install multiple Mozilla products on your computer. You will end up with several folders, for example:

Mozilla Firefox Mozilla Thunderbird Mozilla Sunbird

Short names for them will be

Mozill ~ 1 Mozill ~ 2 Mozill ~ 3

Now imagine that you have written a BAT file mentioning these programs. If you uninstall Firefox, the remaining entries will stop working, and if you uninstall Thunderbird, the entry for Sunbird will stop working. In short, the way with short names is not our way.

Spaces and quotes in bat files

Quotes do work, but not in the ways that are usually advised. Usually the following is advised:

start "C: \ Program Files \ Sound Club \ scw.exe"

So the command will not work, because if you look at the help for it (start /?), Then in the help you will see the following:

START ["title"] [command / program] [parameters]

As you can see, the first parameter is the title of the window and it is just in quotes. This parameter is optional, but it is still advised to specify it () to avoid errors when executing the command. You don't have to write anything inside the quotes. It turns out like this:

start "" "C: \ Program Files \ Sound Club \ scw.exe"

The option of enclosing all names with spaces separately in quotes will also work:

start C: \ "Program Files" \ "Sound Club" \ scw.exe

However, in some cases, none of the above works. In such cases, I can advise using the cd command. Go to the system partition, then use cd to the Program Files folder and run the program (start):

% SystemDrive% cd \ Program Files \ Sound Club \ start scw.exe

I think this method will work everywhere. Now a couple more important points... Let's say you have created a batch file that launches three programs and you need to temporarily exclude the launch of one of the three. This can be done by deleting the line or by commenting it out. The first method is vandal, and the second, see below.

start firefox start jetaudio rem start defraggler

In this case, the launch of the Defraggler.exe program installed on the system is disabled. Comment out lines by specifying the rem command at the beginning of the line. All BAT files are executed in the console window. To make it disappear at the end of the execution of the commands, do not forget to write the command at the end to the exit exit.

start firefox start jetaudio rem start defraggler exit

Running applications from a bat file

In the first part of the article, I gave a general overview of BAT files. Now it became clear - what it is and what it is eaten with. In the second part, we will talk about more specific things. For example, how to run several applications with certain settings using a BAT file, or install the program in automatic mode so as not to waste time on answers like Do you agree with the terms of the license agreement? and do not press unnecessary buttons.

Above, there were several ways to launch applications using a BAT file. The very first is a short command to launch the program installed on the system.

start firefox

It doesn't always work. Therefore, this technique can be fully applied on a specific system, but it is not suitable as a universal solution. If your goal is to make the BAT file work everywhere and always, you need to use full paths:

start C: \ "Program Files" \ "Mozilla Firefox" \ firefox.exe

I also noted that the completion command must be present in the BAT file:

start C: \ "Program Files" \ "Mozilla Firefox" \ firefox.exe exit

Running programs in bat-files with parameters (keys)

You can not just run the program, but give it additional commands at startup. For example, command to run minimized:

start / min D: \ FileZilla \ FileZilla.exe exit

To command in this case means to specify the key. The key is specified with a slash after the main command (command / key). The main command in this case is start. True, the min key works only in half of the cases, because it refers specifically to the start command, and not to the programs that this command starts.

In general, there are a lot of keys and the sets of keys for different programs can differ significantly. There are, however, a few in common. For example, the help key (/? Or / help). To see how this key works, let's look at a practical example. Open the console (Click + R, enter cmd, then Enter) and type the following in the console:

start /?

The console will display a list of valid keys with comments for the start command.

Pay attention to the / wait switch. In some cases, it is simply irreplaceable. For example, you decided to use the BAT file to unpack the archive with the program and run this very program. The batch file will contain two commands - for unpacking and for launching. Since the commands when starting the BAT file will be executed almost simultaneously, the archive will not have time to unpack and there will be nothing to launch. Therefore, there will be an error. In this case, the key will come to the rescue. / wait:

Thus, the system will first perform the first action, wait for its completion, and only then proceed to the second. If you need to wait for a specific period of time, then it is easier to use the console utility. In the right place in the BAT file, write following command(number - number of seconds):

start Sleep.exe 15

You can do a lot with keys. It is possible to install applications. For this, several keys are used, depending on the type of installer used to install the program on the computer:

/ S / s / q / silent and several others

In some cases it is very convenient. Avast Antivirus has a silent install option in the corporate version. In the free (home) version, there is supposedly no silent installation. However, if you know how the InstallShield installer works, you will know that this is a duck, since this installer itself supports the / S silent installation switch. This means that all products made on its basis are the same. And Avast is no exception. Just create a BAT file in the Avast folder with the content

start avast.exe / S exit

run it and the program is installed on your computer with little or no input from you. Thus, you can write a whole list of programs for silent installation and save time, for example, on reinstalling the system. In the article you can get more detailed information by keys.

There are other possibilities for managing programs using BAT files. You can start a program by telling it to open the file on startup. I use this method when developing sites. It is very convenient when all your tools open the necessary documents and folders with the click of just one button:

rem connection to ftp server start / min D: \ FileZilla \ FileZilla.exe "ftp: // login: password @ server" rem opening index.php in Firefox start C: \ "program files" \ "mozilla firefox" \ firefox.exe "http: //localhost/site_folder/index.php" rem opening start.html in a text editor start / min C: \ "Program Files" \ text_editor.exe "E: \ server \ site_folder \ index.html" rem opening folder with site files start / min E: \ server \ site_folder rem exit console exit

Note that all of the above techniques can be used in various combinations and combinations.

start / min / wait program.exe / m / S start C: \ Directory \ program2.exe "C: \ Files \ file.odt" exit

But it is important to remember: everything related to the execution of the program launched in the batch file is written with it in one line.

start C: \ "program files" \ "mozilla firefox" \ firefox.exe "http: //localhost/site_folder/index.php"

As an epilogue, I will offer for review a converter of BAT files into applications in the .exe format -. A BAT file is not always aesthetically pleasing, and with the help of a converter you can pack a batch file into an exe "schnick, decorating it with any icon of your choice.

I came across another BAT to EXE converter, you can consider it as an alternative to the previous program: Advanced Bat To Exe Converter

Microsoft Windows Operating System

Microsoft Windows Operating System platforms mostly used files with .ANI extension, a graphic file format used for animated mouse cursors, which are also defined as Windows Animated Cursor. These files have the same functions with CUR file format or better known as the Static Cursor; its distinction is that being an animated cursor with the use of strings of images to show animation. The format is based on the Microsoft RIFF file format, which is utilized as storage for keeping the individual frames, which are typical Windows icons of the animation. This type of file is usually integrated in a customized theme for desktop, and is helpful to personalize the CPU system. Its final animation is designed with some icon frames are utilized for showing a single image after another to generate animation. Despite a number of frames using the icon format, part of the stored data in the animated cursor file handle the order of the step, length, title, and the author of the animation.

Microsoft Notepad

Microsoft Notepad

Notepad is a basic text editor used to create plain documents. It is commonly used to view or edit text (.txt) files, and a simple tool for creating Web pages, and supports only the basic formatting in HTML documents. It also has a simple built-in logging function. Each time a file that initializes with .log is opened, the program inserts a text timestamp on the last line of the file. It accepts text from the Windows clipboard. This is helpful in stripping embedded font type and style codes from formatted text, such as when copying text from a Web page and pasting into an email message or other à ¢ €Š“What You See Is What You Getà ¢ €  text editor. The formatted text is temporarily pasted into Notepad, and then immediately copied again in stripped format to be pasted into the other program. Simple text editors like Notepad may be utilized to change text with markup, such as HTML. Early versions of Notepad offered only the most basic functions, such as finding text. Newer versions of Windows include an updated version of Notepad with a search and replace function (Ctrl + H), as well as Ctrl + F for search and similar keyboard shortcuts. It makes use of a built-in window class named edit. In older versions such as Windows 95, Windows 98, Windows Me and Windows 3.1, there is a 64k limit on the size of the file being edited, an operating system limit of the EDIT class.

In this article, we will look at two ways to create a bat file: using Explorer and using Notepad. This will be enough to create new bat files, but first, let's decide what they are for. To put it quite simply, the bat-file is needed in order to write a set of commands for Windows command line and then execute them at any time without typing each time. In general, ideal for lazy and / or sysadmins. =)

I'll get down to business right away:

Method one. We create bat file v " Explorer»

I'll make a reservation right away that for this method you need to have enabled display of file extension in "Explorer"... This is convenient in many cases and I don't understand why this feature is disabled by default in Windows.

Change its extension(what's after the last dot) on .bat:

After we press Enter, Windows will ask “After changing the extension, this file may not be available. Do you want to change? " Of course "Yes"! This is exactly what we are trying to achieve: change the .txt extension to .bat:

Voila! We received a "batch file", i.e. an executable file into which you can enter commands that will be executed when it starts:

Method two. We create bat file v " Notepad»

To create a bat file using " Notepad", need to open "Notepad"(or any text file in Notepad) and use the menu " File", Option" ":

The save file window will open. It is important to consider 2 things here:

  1. « File type"Must be displayed on All files (*.*)
  2. « File name"Must have the extension .bat

We look where we save (so that we can find it later) and press the button " Save»:

Total:

Any of these methods makes sense if you have administrator rights. But the first one requires additional settings(which I still recommend to change and apply).

Windows bat files are a convenient way to perform various tasks on a PC, which is actively used by computer craftsmen. They allow you to automate everyday tasks, reduce their execution time and turn a complex process into something feasible for an ordinary user. This article introduces the basic features batch files and recommendations for self-writing.

Automation made easy

How to create a bat file? To do this, follow these steps:

  1. In any text editor, for example, Notepad or WordPad, create a text document.
  2. Write your commands in it, starting with @echo, and then (each time on a new line) - title [name of the batch script], echo [message to be displayed] and pause.
  3. Save text in an electronic document with a .bat extension (for example, test.bat).
  4. To run, double-click on the batch file you just created.
  5. To edit it, you need to click on it right click mouse and select "Change" from the context menu.

The raw file will look something like this:

title This is your first bat file script!

echo Welcome to the batch script!

More details about the commands of bat-files and their use will be discussed below.

Step 1: creating a program script

Let's assume that a user often has problems with the Network. He uses the command line all the time, typing ipconfig and pinging Google to troubleshoot the web. After a while, the user realizes that it would be much more efficient if he wrote a simple bat file, wrote it to his USB drive, and ran it on the computers he diagnoses.

Create a new text document

A batch file makes it easy to perform repetitive tasks on your computer by using the Windows command line. Below is an example of a script responsible for displaying some text on the screen. Before creating a bat file, right-click on an empty spot in the directory and select New and then Text Document.

Adding code

Double clicking on this new text document will open the default text editor. You can copy and paste the above code example into a text entry.

Preservation

The above script displays the text "Welcome to the batch script!" An electronic document must be recorded by selecting the menu item text editor"File", "Save As", and then specify the desired name for the bat-file. It should be completed with the .bat extension (for example, welcome.bat) and click "OK". For the correct display of the Cyrillic alphabet, in some cases, you should make sure that the right choice encodings. For example, when using the console of the Russified Windows NT system, the document must be saved in CP866. Now you need to double click on the shortcut to the bat file to activate it.

But the screen will display:

"Welcome to the batch script! Press any key to continue ..."

If the bat file does not start, users recommend entering the register and deleting the key:

"HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \ .BAT \ UserChoice".

Don't think that this is all that batch scripts are capable of. Script parameters are modified versions of command line commands, so the user is limited only by their capabilities. And they are quite extensive.

Step 2: getting to know some of the commands

If a PC user is familiar with how to execute DOS console commands, then he will be a wizard for creating program scripts, because it is the same language. The lines in the bat files will tell the cmd.exe interpreter everything that is required of it. This saves time and effort. In addition, it is possible to define some logic (for example, simple loops, conditionals, etc., which are conceptually similar to procedural programming).

Built-in commands

1. @echo is a bat-file command that will allow you to see the script work on the command line. It is used to view the progress of the running code. If the batch file has any problems, then this command will quickly isolate the problems. Adding off makes it possible to quickly terminate the execution of the code, avoiding the display of unnecessary information on the screen.

2. Title provides the same capabilities as the tag in HTML, that is, it creates a header for a batch script in a command prompt window.</p><p>3. Call calls one bat-file from another or a subroutine within one script. For example, the power function calculates the power% 2 of% 1:</p><p>if% counter% gtr 1 (</p><p>set / a counter- = 1</p><p>endlocal & set result =% prod%</p><p><img src='https://i1.wp.com/syl.ru/misc/i/ai/324915/1862019.jpg' width="100%" loading=lazy loading=lazy></p><p>4. Cls clears <a href="https://olacom.ru/en/security/tightvnc-zapusk-iz-komandnoi-stroki-udalennoe-upravlenie-linux-iz-windows/">command line</a>... Used to prevent previous output of extraneous code from interfering with viewing the progress of the current script.</p><p>5. Color sets the color of the font and background. For example, the command color f9 sets white letters on a blue background. Command without parameter restores default settings.</p><p>6. Echo is used to output information, as well as enable (echo on) or disable (echo off) such output. For example, the echo command. deduces <a href="https://olacom.ru/en/toys/strokovye-funkcii-v-zaprose-1s-8-3-novye-funkcii-raboty-so-strokami/">new line</a> without a dot, but echo. - point. Without parameters, the command displays information about its current status - echo on 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 bat-file commands. This makes it possible to read the executed lines before continuing with the program. In this case, the message "To continue, press any key ..." is displayed on the screen.</p><p>9. Set allows you to view or set environment variables. With the / p switch, the command prompts the user for input and saves it. With the / a parameter, it allows you to perform simple arithmetic operations, also assigning their result to a variable. When operating with strings, there should be no spaces either before or after the equal sign. For example, set displays a list of environment variables, set HOME displays the values ​​of arguments starting with “HOME,” and set / p input = enter an integer: prompts for an integer and assigns it to the appropriate variable.</p><p>10. Start "" [website] will start the specified website in the default web browser.</p><p>11. If serves to check a specific condition. If it is true, then the command following it is executed. There are 3 types of conditions:</p><ul><li>ERRORLEVEL number - check the exit code of the last executed instruction for compliance with or exceeding the specified number. In this case, 0 indicates the successful completion of the task, and any other number, usually positive, indicates an error. For example, you can use nested commands to accurately determine the exit code: if errorlevel 3 if not errorlevel 4 echo error # 3 has occurred.</li><li>String1 == string2 - check if two strings match. For example, if there is no external parameter, the command if "% 1" = = "" goto ERROR will transfer control to the label ERROR.</li><li>EXIST name - check for the existence of a file with <a href="https://olacom.ru/en/toys/fail-mso-chem-otkryt-mso-eto-vozmozhno-chto-rasshirenie-imeni-faila/">specified name</a>... For example, if not exist A: \ program.exe COPY C: \ PROJECTS \ program.exe A: copies program.exe to drive A if it is not there.</li> </ul><p>12. Else must be on the same line with the If command. Indicates that the next statement is to be executed if the expression evaluates to false.</p><p><img src='https://i2.wp.com/syl.ru/misc/i/ai/324915/1862021.jpg' width="100%" loading=lazy loading=lazy></p><p>13. For is used to repeat certain actions with each member of the list. It has the format for %% argument in (list) do command. The argument can be any letter from A to Z. A list is a sequence of strings separated by spaces or commas. Wildcards can also be used. For instance:</p><ul><li>for %% d in (A, C, D) do DIR %% d - sequentially displays the directories of drives 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: \ BAT - copies all batch files that exist in all directories of the search route to the folder C: \ BAT.</li> </ul><p>14. A colon (:) before a word forms a link from it, which allows you to skip a part of the program code or go back. It is used with the Call and Goto commands, indicating where to continue executing the bat-file, for example, when a certain condition is met:</p><p>15. Variables:</p><ul><li>%% a stands for every file in the folder;</li><li>% CD% - current directory;</li><li>% DATE% - system date, the format of which depends on the localization;</li><li>% TIME% - system time in the form of HH: MM: SS.mm;</li><li>% RANDOM% - generated pseudo-random number in the range from 0 to 32767;</li><li>% ERRORLEVEL% - exit code returned by the last executed command or bat script.</li> </ul><p>You can extract the part of a string that is contained in a variable, given its position and length, as follows:</p><p>% [variable]: ~ [start], [length]%. For example, you can display the date in the format DD / MM / YYYY as YYYY-MM-DD like this: echo% DATE: ~ 6.4% -% DATE: ~ 3.2% -% DATE: ~ 0.2%.</p><p>16. (". \") - root folder. When working with the console, before changing the file name, deleting it, etc., you must direct the command action to a specific directory. When using a batch file, just run it in any directory you want.</p><p>17.% digit - takes the values ​​of parameters passed by the user to the bat-file. Can be separated by spaces, commas, or colons. Digit is a number from 0 to 9. For example,% 0 is the value of the current command. % 1 matches the first parameter, and so on.</p><p>18. Shift - the command used to shift <a href="https://olacom.ru/en/tips/ms-sql-server-procedury-hranimye-procedury-primer-sozdaniya/">input parameters</a> one position. Applies when external arguments are passed to the batch file. For example, the following bat file copies the files specified as parameters on the command line to the D drive:</p><p>if not (% 1) == () goto next</p><p>In addition, the following manipulations can be performed with the arguments:</p><ul><li>% ~ - remove surrounding quotes;</li><li>% ~ f - expand the parameter to the full path name along with the drive name;</li><li>% ~ d - show disk name;</li><li>% ~ p - display only the path;</li><li>% ~ n - select only the file name from the parameter;</li><li>% ~ x - keep only the extension;</li><li>% ~ s - convert path to short name representation;</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: - Searches the directories listed in the PATH environment variable and expands the parameter to the first matching full name found, or returns an empty string on failure.</li> </ul><p><img src='https://i0.wp.com/syl.ru/misc/i/ai/324915/1862020.jpg' width="100%" loading=lazy loading=lazy></p><h2>Wildcards</h2><p>Many commands accept filename patterns — characters that match a group of filenames. Wildcards include:</p><ul><li>* (asterisk) - denotes any sequence of characters;</li><li>? (question mark) - replaces one (or 0) character other than a period (.).</li> </ul><p>For example, the dir * .txt command displays a list of txt files, and dir ???. Txt - a list of text documents whose name does not exceed 3 letters.</p><h2>Functions</h2><p>Like subroutines, they are emulated with call, setlocal, endlocal, and labels. The following example demonstrates the ability to define a variable in which the result is stored in the call line:</p><p>call: say result = 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 32-bit integers and bits using the set / a command. The maximum supported number is 2 ^ 31 - 1 = 2147483647, and the minimum is - (2 ^ 31) = -2147483648. The syntax is similar to the C programming language. Arithmetic operators include: *, /,%, +, -. In bat-file% (remainder of integer division) should be entered as “%%”.</p><p>Operators with <a href="https://olacom.ru/en/video/dvoichnaya-sistema-schisleniya-perevod-chisel-iz-odnoi-sistemy/">binary numbers</a> interpret the number as a 32-bit sequence. These include: ~ (bitwise NOT or complement), & (AND), | (OR), ^ (exclusive OR),<< (сдвиг влево), >> (shift to the right). The logical negation operator is! (Exclamation point). It changes 0 to 1 and a nonzero value to 0. The combination operator is, (comma), which allows more operations to be performed in a single set command. The combined assignment operators + = and - = in the expressions a + = b and a- = and correspond to the expressions a = a + b and a = a-b. * =,% =, / =, & =, | =, ^ =, >> =,<<=. Приоритет операторов следующий:</p><p>(); %+-*/; >>, <<; &; ^; |; =, %=, *=, /=, +=, -=, &=, ^=, |=, <<=, >>=; ,</p><p>Literals can be entered as decimal, hexadecimal (with leading 0x), and octal (with leading zero). For example, set / a n1 = 0xffff assigns n1 a hexadecimal value.</p><h2>External commands</h2><ul><li>Exit is used to exit the DOS console or (with the / b option) 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 estimate its distance and latency (response). Also used to set a pause. For example, ping 127.0.01 -n 6 pauses code execution for 5 seconds.</li> </ul><p>The bat command library is huge. Fortunately, there are many pages on the web that list them all, along with batch script variables.</p><p><img src='https://i0.wp.com/syl.ru/misc/i/ai/324915/1862017.jpg' width="100%" loading=lazy loading=lazy></p><h2>Step 3: writing and running the bat file</h2><p>The following script will greatly simplify your daily online activity. What if you want to instantly open all your favorite news sites? Since the scripts use console commands, you can create a script that opens each news feed in a single browser window.</p><p>Next, you should repeat the process of creating a bat-file, starting with an empty text document. To do this, right-click on an empty space in a folder and select "New", and then - "Text Document". After opening the file, you need to enter the following script, which launches the main Russian-language 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=ru_ru&hl=ru</p><p>This script contains start “” commands that open multiple tabs. You can replace the suggested links with any others of your choice. After entering the script, go to the editor's menu "File", and then to "Save as ..." and write a document with the extension .bat, changing the "File type" parameter to "All files" (*. *).</p><p>After saving, to run the script, just double-click on it. The web pages will start loading instantly. You can optionally place this file on your desktop. This will give you instant access to all your favorite sites.</p><h2>Organizer</h2><p>If you upload several files a day, then soon hundreds of them will accumulate in the Downloads folder. You can create a script that will order them by type. It is enough to place the .bat file with the program in a folder with unorganized data and double-click to run:</p><p>rem Each file in the folder</p><p>for %% a in (". \ *") do (</p><p>rem check for extension and not belonging to this script</p><p>if "%% ~ xa" NEQ "" if "%% ~ dpxa" NEQ "% ~ dpx0" (</p><p>rem check for the existence of a folder for each extension, and if it does not exist, then create</p><p>if not exist "%% ~ xa" mkdir "%% ~ xa"</p><p>rem move file to folder</p><p>move "%% a" "%% ~ dpa %% ~ xa \"</p><p>As a result, the files in the "Downloads" directory are sorted into folders, the names of which correspond to their extension. It is so simple. This batch script works with any type of data, be it document, video or audio. Even if the PC doesn't support them, the script will still create a folder with the appropriate label. If there is already a JPG or PNG directory, the program will simply move the files with this extension there.</p><p>This is a simple demonstration of what batch scripts are capable of. Whether it's organizing files, opening multiple web pages, bulk renaming, or making copies of important documents for a simple task, a batch script can help you get the tedious job done in a couple of clicks.</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 class="single-popular"> <div class="single-popular-tit col-lg-12">Popular in the heading:</div> <div class="single-popular-item col-lg-6 col-md-6 col-sm-6 col-xs-6"> <div class="single-popular-item-wrp"> <img width="150" height="120" src="/uploads/ddd5bc0242dd6d8a2fdccd5d6f028813.jpg" class="attachment-sm-widget size-sm-widget wp-post-image" alt="From server to MFP: how to accommodate unusual office equipment"/ loading=lazy loading=lazy> <div class="single-popular-item-tit">From server to MFP: how to accommodate unusual office equipment</div> <a href="https://olacom.ru/en/mozilla-firefox/kseroks-kakaya-amortizacionnaya-gruppa-ot-servera-do-mfu-kak-uchest/" rel="bookmark" title="From server to MFP: how to accommodate unusual office equipment">read</a> <div class="clr"> </div> </div> </div> <div class="single-popular-item col-lg-6 col-md-6 col-sm-6 col-xs-6"> <div class="single-popular-item-wrp"> <img width="150" height="120" src="/uploads/5adfd1c41e49dd72347de006d5fee213.jpg" class="attachment-sm-widget size-sm-widget wp-post-image" alt="How I stumbled into config"сборщик мобильных приложений""/ loading=lazy loading=lazy> <div class="single-popular-item-tit">How I stumbled upon the "mobile app builder" configuration</div> <a href="https://olacom.ru/en/google-chrome/skachat-konfiguraciyu-sborshchik-mobilnyh-prilozhenii-kak-ya/" rel="bookmark" title="How I stumbled into config"сборщик мобильных приложений"">read</a> <div class="clr"> </div> </div> </div> <div class="single-popular-item col-lg-6 col-md-6 col-sm-6 col-xs-6"> <div class="single-popular-item-wrp"> <img width="150" height="120" src="/uploads/a88b83496ca2fae7a18e29f824921b14.jpg" class="attachment-sm-widget size-sm-widget wp-post-image" alt="1c 8 full connection. Joins in queries"/ loading=lazy loading=lazy> <div class="single-popular-item-tit">1c 8 full connection. Joins in queries</div> <a href="https://olacom.ru/en/mozilla-firefox/1s-8-polnoe-soedinenie-soedineniya-v-zaprosah/" rel="bookmark" title="1c 8 full connection. Joins in queries">read</a> <div class="clr"> </div> </div> </div> <div class="single-popular-item col-lg-6 col-md-6 col-sm-6 col-xs-6"> <div class="single-popular-item-wrp"> <img width="150" height="120" src="/uploads/3c965f9d6d2cfaaf8445852a0576c601.jpg" class="attachment-sm-widget size-sm-widget wp-post-image" alt="Overriding input event by line"/ loading=lazy loading=lazy> <div class="single-popular-item-tit">Overriding input event by line</div> <a href="https://olacom.ru/en/interesting/1s-pole-vvoda-zapolnenie-po-stroke-pereopredelenie-sobytiya-vvoda/" rel="bookmark" title="Overriding input event by line">read</a> <div class="clr"> </div> </div> </div> <div class="clr"></div> </div> </div>  <div class="sidebar col-lg-3 col-md-4 col-sm-12"> <div class="sidebar-wrp"> <div class="sidebar-wrp-title">Latest Articles</div> <div class="sidebar-wrp-des"> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/317de36860777a92c097cd6cde62ead9.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Align Lines Align Line</div> <div class="clr"></div> <a href="https://olacom.ru/en/toys/vyrovnyaite-linii-po-kvadratu-vyravnivayushchie-linii-vyrovnyat/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/5af048ee5379bc979ad0dc73eedf9807.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Step-by-step filling of the program zik 3</div> <div class="clr"></div> <a href="https://olacom.ru/en/mozilla-firefox/po-shagovoe-zapolnenie-programmy-zik-3-1-poluchit-ee-mozhno-odnim-iz/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/7fa929787f566576b53e3f7e7b438952.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">When to use search processing and ...</div> <div class="clr"></div> <a href="https://olacom.ru/en/interesting/obrabotka-poiska-i-zameny-znachenii-kod-1s-kogda-nuzhno/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/17941b1d519d809c6e6aae04020abc9d.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">060 time. How to find out the exact time. Option...</div> <div class="clr"></div> <a href="https://olacom.ru/en/google-chrome/060-vremya-kak-uznat-tochnoe-vremya-opciya-tochnoe-vremya/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/5537ec49fc543370b977bb681b7448d8.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Beeline service "Happy time</div> <div class="clr"></div> <a href="https://olacom.ru/en/ssd/kak-rabotaet-schastlivoe-vremya-bilain-usluga-bilain-schastlivoe-vremya-za-kakie-deistviya-ne-nachislyayu/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/de96c9ce2d9d0ea31483530201a81c2f.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Data composition system - practice ...</div> <div class="clr"></div> <a href="https://olacom.ru/en/mozilla-firefox/posty-s-tegami-konsol-sistema-komponovki-dannyh---praktika/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/28814a44dc707e281c8927b985f9da5b.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Accounting of a public institution ...</div> <div class="clr"></div> <a href="https://olacom.ru/en/toys/buhgalteriya-gosudarstvennogo-uchrezhdeniya-redakciya-2-v-nastroika-tipa-zagruzhaemyh-dokumentov/">read</a> </div> <div class="last-post col-lg-12 col-md-12 col-sm-6 col-xs-6"> <div class="last-post-img"> <img width="60" height="48" src="/uploads/9df3ea001a67fc628c0dbe401a761c3d.jpg" class="attachment-sm-widget2 size-sm-widget2 wp-post-image" alt="" / loading=lazy loading=lazy> </div> <div class="last-post-tit">Eco Inform - news agency</div> <div class="clr"></div> <a href="https://olacom.ru/en/tips/rpn-lichnyi-kabinet-eko-inform-informacionnoe-agentstvo/">read</a> </div> <div class="clr"></div> </div> </div> <div id="text-4" class="widget widget_text sidebar-wrp"> <div class="textwidget"> </div> </div> <div class="clr"></div> </div> </div> </div> </div> <div id="footer"> <div class="container"> <div class="row"> <div class="footer-contacts col-lg-6 col-md-6 col-sm-12 col-xs-12"> <img src="/public/logo.png" loading=lazy loading=lazy> <div class="footer-contacts-tit">olacom.ru <br>Interesting and useful programs</div> <div class="footer-soc"> <div class="footer-soc-wrp"> <div class="soc_w"> <a href="#" class="soc-link vk" target="_blank"></a> <a href="#" class="soc-link fb" target="_blank"></a> </div> </div> </div> </div> <div class="footer-links col-lg-4 col-md-6 col-sm-12 col-xs-12"> </div> <div class="footer-links col-lg-4 col-md-4 col-sm-4 col-xs-4" style="display: block;"> <ul> <li><a href="">Project revision</a></li> <li><a href="">Advertising on the website</a></li> </ul> <ul> <li><a href="">Contacts</a></li> <li><a href="https://olacom.ru/en/sitemap.xml">site `s map</a></li> </ul> </div> </div> </div> <div class="copyright">© 2021 Interesting and useful programs</div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="https://olacom.ru/wp-content/themes/trudinsp/js/bootstrap.min.js"></script> <script type="text/javascript" src="https://olacom.ru/wp-content/themes/trudinsp/js/SmoothScroll.js"></script> <a id="scroll-to-top" href="#" title="Scroll to Top">Top</a> <script type='text/javascript' src='https://olacom.ru/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.51.0-2014.06.20'></script> <script type='text/javascript' src='https://olacom.ru/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.4.1'></script> <script type='text/javascript' src='https://olacom.ru/wp-content/plugins/jquery-smooth-scroll/js/jss-script.min.js?ver=4.8.3'></script> <script type='text/javascript' src='https://olacom.ru/wp-content/plugins/table-of-contents-plus/front.min.js?ver=1509'></script> <script type='text/javascript' src='/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4'></script> <script type='text/javascript' src='/wp-includes/js/jquery/ui/effect-blind.min.js?ver=1.11.4'></script> <script type='text/javascript'> /* <![CDATA[ */ var stbUserOptions = { "mode":"css","cssOptions":{ "roundedCorners":false,"mbottom":20,"imgHide":"http:\/\/olacom.ru\/wp-content\/plugins\/wp-special-textboxes\/themes\/stb-metro\/minus.png","imgShow":"http:\/\/olacom.ru\/wp-content\/plugins\/wp-special-textboxes\/themes\/stb-metro\/plus.png","strHide":"\u0421\u043a\u0440\u044b\u0442\u044c","strShow":"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c"} }; /* ]]> */ </script> <script type='text/javascript' src='https://olacom.ru/wp-content/plugins/wp-special-textboxes/js/wstb.min.js?ver=5.5.101'></script> <script type='text/javascript' src='/wp-includes/js/wp-embed.min.js?ver=4.8.3'></script> <script type="text/javascript" id="slb_context">/* <![CDATA[ */if ( !!window.jQuery ) { (function($){ $(document).ready(function(){ if ( !!window.SLB ) { { $.extend(SLB, { "context":["public","user_guest"]} );} } })} )(jQuery);} /* ]]> */</script> </body> </html>