Writing bat files for dummies. Writing bat files - examples of batch files. Creating a new text document

Anyone can write bat files!

Command processor

Many operating systems, including those developed by Microsoft, include a command processor. This is the name of a program that initiates the execution of all sorts of actions in response to commands entered by the user from the keyboard. Basically, these actions are to start required programs with certain parameters. But not only; further we will see that some commands are executed directly by the shell. Basically, these are the commands that serve to control the context and sequence of command execution. However, we will not think too deeply about the nature of commands, at least not unnecessarily. More importantly, any program that is technically possible to run from the command line is treated as a command by the shell. It makes no distinction between the "native" commands originally built into the operating system and the programs that were installed on top of it.

To start the command processor:

    Click on the button Start... The main menu will be displayed.

    Select Run from the main menu. A dialog box will be displayed Launching the program.

    In the Open box, enter the string cmd.

    Click on the button OK... A shell window will be displayed.

Command line and commands

The shell window looks gloomy in its original form, and it is not very convenient for most people to work with it. Much easier to use file managers in the style of Norton Commander. They provide both a means for quick navigation through the file system and a time limit for entering commands.

To enter the command:

    Type the command text at the command line.

    Press the key Enter.

Command Processor and Commands operating system described in the operational documentation for the latter. This documentation is partly contained within the operating system itself. To access it, use the command help... This command displays a list of available commands on the screen. In order to get a description of a specific command, as a parameter, the command help her name should be indicated. The command line shown in the following listing displays the command description for.

If you tried to enter the command help, you probably noticed that the result of her work (the so-called issue) does not fit on one screen. The same problem occurs with the command description text for... The good news is that the output can be redirected to a file. The command line shown in the following listing generates the file commands.txt containing a list of all MS-DOS commands.

help> commands.txt

In order to generate a file with a command description for, you need to give such a command (you can make the name of the output file anything you like).

help for> for.txt

There are a little less than 80 commands in modern operating systems of Microsoft corporation, and it is impossible to describe them in one article. Here we can only mention a few commands useful for automating file processing and show how to use them. These commands will be used further in the examples. You can always clarify the details by command help or in the reference.

copy- copying one or more files;

del- deleting one or more files;

move- moving one or more files or directories;

rename(abbreviated ren) - rename one or more files or directories;

Xcopy - copying a tree of subdirectories;

mkdir(abbreviated md) - creating a directory;

rmdir(abbreviated rd) - deleting a directory.

One of the general rules of MS-DOS command syntax is that when specifying parameters, you specify the source first, and then the result. For example, if we want to move the file beer.txt from catalog box to catalog table, we must enter the command shown in the following listing.

move box \ beer.txt table

First, what to move, then where to move.

If we want to rename the file lena.txt to file natasha.txt then the command should be written as shown below.

ren lena.txt natasha.txt

First what to rename, then what to rename.

Current directory. Absolute and relative paths

When working with file commands, the concept of the current directory becomes extremely important. The fact is that when specifying a file as a command parameter, we always use one of two possible ways to point to them: either an absolute path or a relative path. In the full path, we indicate everything, starting with the disk (or the network name of the computer), for example d: \ misha \ box \ beer.txt... Whichever directory is current at the time the command is entered, the full path will correspond to the same file. For a relative path, the current directory is the starting point. The simplest case for a relative path is a filename. In the context of command execution, it means a file of that name located in the current directory.

There is a conditional entry to write the relative path to the current directory . (point). To write the relative path to the directory that contains the current directory, there is a conditional entry .. (two dots). The command shown in the following listing copies all files from the current directory to the directory neighbor located next to it.

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 the 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 foaming at the mouth to argue 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. Firefox is one such program:

start firefox

If after this command you write the path to the executable file, then the following happens: starts Firefox browser 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. Let's take a Filezilla ftp client as an example. Since the system does not know about the program, the above line

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 next to it, 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 counted 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 short name method 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 system partition, then 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

V 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 to the exit at the end.

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, about 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. There will be two commands in the batch file - 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 the 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 understand that this is a duck, since this installer itself supports the silent installation switch / S. 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, 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 a file on startup. I use this method when developing websites. It is very convenient when all your tools open required documents and folders with just one click:

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 to applications in the .exe format -. BAT file is not always aesthetically pleasing, and with the help of the converter you can pack a batch file into an exe "shnik", 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

In this article, we will consider such useful thing how " body shirt". Let's first define what a bat file is. Batch or batch files are simple text files that contain sets of commands ( instruction) interpreter and having the bat or cmd extension ( cmd works only in NT operating systems). You can create and edit such files using a regular notepad or any other text editor.

Now you ask, why do you need to be able to write such baht files? And why are they needed? I will try to explain.

First, they are used to make work easier, i.e. for example, you need to constantly perform some operation every day ( for example, create an archive of certain documents), with the help of a batch file, this can be automated, and you will no longer take part in this.

Secondly, these batch files are very powerful ( unless of course you know how to write them), i.e. You can even write a nice program ( I mean by functionality). Personally, they help me a lot in my work, and I just forgot about some things when I did it manually.

Now let's go directly to the basics of these body shirts. How they are created, you just need to create a simple text document to open it and immediately on the tab " File-> save as", Write instead of the extension" Text document.txt", for example " Text document .bat"And save, so we will get a batch file with the .bat extension, but it does nothing yet.

To begin with, I will give an example of a batch file that I use at my work to archive documents.

"C: \ Program Files \ WinRAR \ winrar.exe" a -r -dh -ed -agYYYY-mm-dd E: \ arhaccounts \ d: \ accounts \ *. Doc "C: \ Program Files \ WinRAR \ winrar. exe "a -r -dh -ed -agYYYY-mm-dd E: \ arhaccounts \ d: \ accounts \ *. xls" C: \ Program Files \ WinRAR \ winrar.exe "a -r -dh -ed -agYYYY -mm-dd E: \ arhaccounts \ d: \ accounts \ *. txt

Now I'll tell you a little what this batch file does. WinRar starts, then the Winrar commands follow:

  • a - this is to add to the archive;
  • -r - process subfolders;
  • -dh - open shared files;
  • -ed - do not add empty folders;
  • YYYY-mm-dd - add the current date to the archive name ( date format);
  • E: \ arhaccounts \ - path where the final archive will be located;
  • d: \ accounts \ *. doc - path and mask of files to archive.

In this case, we archive all Word documents, Excel and text files, we do not need to archive the rest. We are archiving to another disk, and we also copy the resulting archive to another computer, so that the archives are stored in another office. Copying is carried out over the network, respectively, the computer to which the archive is copied must be turned on. To do this, you can use the following command:

Copy E: \ arhaccounts \ *. Rar \\ namecomp \ arhiv \

Examples of commands for bat files

Now let's take a look at the basic commands that you can use.

If you need to delete a file, write the following:

Del d: \ file \ test.doc

In order to delete the entire directory, write:

Rd d: \ file \

Suddenly you need to delete everything from a directory every time, then use this:

Echo Y | del d: \ file \

  • del d: \ file \ - this is exactly the deletion of all files;
  • echo Y | - the command confirms the deletion because if you do not register this command, then you will see a message confirming the deletion - "Continue", and you will need to answer this question every time.

Now let's look at a more complicated example, in which the condition is already met:

@echo off "C: \ Program Files \ WinRAR \ winrar.exe" x -O + -IBCK d: \ test \ test.rar d: \ test IF not EXIST d: \ test \ 123.rar GOTO 1 IF EXIST d: \ test \ 123.rar GOTO 2: 2 "C: \ Program Files \ WinRAR \ winrar.exe" x -O + -IBCK d: \ test \ 123.rar c: \ del d: \ test \ 123.rar: 1 del d: \ test \ test.rar end

Now I explain, let's say you need to unzip the test.rar archive, which will contain a lot of files, but if there is a 123.rar file, you will need to unzip it to the root of the C drive, and the rest of the files to remain in the same directory untouched.

In order, the @echo off command is needed so that nothing is reflected on the screen ( in principle, if you do not need, you can not write this line). Next, we run Winrar and unpack the test.rar archive into the test folder. Then comes the condition if in the test ( after unpacking test.rar) we will not have the 123.rar file, then we just execute the batch file goes to the line: 1 and then the test.rar file is simply deleted for unnecessary reasons. we have already unpacked everything that we need. But if the file 123.rar is there, then the batch file goes to line: 2, after which the file 123.rar is unpacked to the root of the C drive. In other words, we have the condition, if there is a file, then do it, if there is no file, do this. Let's say, if you do not write the condition in this example, then our batch file will give an error when we do not have the 123.rar file in this folder.

Now let's consider such an example, let's say you need to move files from the directory located on disk D to a USB flash drive every time. Every time you have to enter my computer drive D, choose desired folder, select all files from it and cut, and then just go to the USB flash drive and paste. With the help of a batch file, this is done in one click ( with one condition that the flash drive will be, for example, a G disk or whatever you have). Here is an example of such a batch file:

Move "D: \ catalog \ *. Doc" G: \ catalognaflehe \

And all files with the doc extension that are in the D: \ catalog directory will be moved to the USB flash drive. Now I want to say that in body shirts you can use scripts ( scripts) using Windows Scripting Host and if necessary, for example, to display a message after the files are copied ( previous example) paste this:

Echo var WSHShell = WScript.CreateObject ("WScript.Shell"); >% temp% \ mes.js echo WSHShell.Popup ("Files Copied"); >>% temp% \ mes.js start% temp% \ mes.js deltree / y% temp% \ mes.js

In fact, you can talk a lot about writing body shirts and, of course, you cannot fit it into one article, here I showed only the principles that are used when writing bat files, so to speak the basis. If you want to know more commands for writing batch files, you can easily view them by typing in the command line ( Start - Run - cmd) the help command, but, of course, there are not all commands that can be used in body shirts. Good luck writing BAT files ( batnikov).

To open the command line in the right place (in a folder with files, for example), you need to call the context menu (RMB) while holding down the Shift key:

How to work with the command line you. Let's go directly to the commands.

A list of all console commands with a description can be obtained by typing help in the console
Help for any command can be obtained using the /?
For example: DIR /? will display help for all keys of the DIR command

Deleting temporary files before shutting down the computer

I think that everyone at least or came across them personally. The bat file will help you shut down the computer properly by deleting temporary files, into the folder with which the virus usually downloads.

The next time the device is booted (at an early stage), the virus makes entries in the registry, disrupting the normal operation of the system. And when the desktop boots up, the situation is harder to fix.

Of course, not all viruses work according to this scheme, but nevertheless, clearing temporary files and the system cache before shutting it down significantly reduces such risks.

start / wait "" "C: \ Program Files \ CCleaner \ CCleaner64.exe" / auto start / wait "" "C: \ WINDOWS \ System32 \ shutdown.exe" / s / t 10

CCleaner is not available in Windows by default. It needs to be installed separately. You can download the installer on the developer's website.

CCleaner starts first and removes all temporary files on the computer. Then the computer shutdown program is launched with a 15 second delay to avoid possible conflicts with CCleaner.

You must also copy this example into it. Display the shortcut to the bat-file on the desktop, assign it a nice icon and turn off the computer using this shortcut button.

Get a list of files in a folder using a bat file

I periodically use bat files to get lists of files in folders. A common situation: at work, clients send an archive with photographs from a photographer. Photos are named according to the SKUs of the goods.

There is no textual information accompanying the photo. It is necessary to make a list based on the photos sent and import it into the product catalog on the site. Several photos were taken for each product. They are named like this:

  1. Photo of the product with the article A1234 (2) .jpg
  2. Photo of the product with the article B1234 (2) .jpg

First, I get a list of all the files in the folder using the following command:

dir * .jpg / B / L> filelist.txt

The * .jpg command will only take JPG files into account when compiling the list. The / B switch will allow you to get a list containing only the names of the files located in the folder. The / L switch will print all names in lowercase. The> filelist.txt command will create a text file named filelist and write the result there.

The next step is to get rid of duplicates so that there is only one entry for each product in the list:

type filelist.txt | findstr / I / V "(2)"> temp.txt

Findstr will search the previously retrieved file. The / I switch allows you to search for records in a case insensitive manner, and the / V switch writes lines that do not contain the desired match. The quotes indicate the string to be matched. And the last command> temp.txt will write to the temp file all results that do not contain "(2)" in the name. As a result, I will get:

  1. Product photo with article number А1234.jpg
  2. Product photo with article number В1234.jpg

If you need to perform the opposite operation - to output only matches to the temp.txt file, then you will not find the one you need in the list of commands (findstr /?). There is only an inverse exact match filter - / X.

For this task, you can use the command to display the number of lines / N in which there are matches (numbers are displayed along with the line):

type filelist.txt | findstr / I / N "(2)"> temp.txt

The main thing to remember when working with text information (text files) is:

If for text operations you use a file that was not created via the command line as a source, it must be in the encoding that is understood by the command line. For example, CP1251 (ANSI).

Otherwise, you risk getting something like this at the output:

Copy directory tree without files

When I start making new projects, it becomes necessary to get a directory tree similar to the old project one with the difference that there should be no files in it. For a new project, it is easier to add 3-5 files to the necessary empty folders than to copy an existing project and then delete unnecessary ones from there.

Receive directory tree without files using the following command:

xcopy folder_1 folder_2 / T / E

The xcopy command takes as a basis the directory tree at folder_1 and creates a copy of it in the folder_2 folder. The / T switch allows copying directories without copying the files in them. The / E switch specifies that all directories must be copied, incl. empty.

Optimally, to get a directory tree, you need to open a command line in the parent folder of the donor directory and create a directory in the same folder where the copied tree will be placed. In this case, it will be enough for the command to specify the names of the donor folder and the destination folder (as in the example above).

We all had to deal with routine tasks from day to day at work, and not only.

For example:

You can also cite many examples of common tasks on which it is better not to waste your time, but to automate the process. Today I want to tell you how basic bat scripts are written.

Let's take a look at the first example:

It is necessary to delete all files from the exchange folder once a month.

  1. We open WordPad, notepad will not work, it cannot save in 866 encoding.
  2. We write:

del / q "c: \ exchange \"

The del command deletes files, the q key says to delete files without user confirmation, then the path to the exchange folder goes, the pause command is for your convenience, so that the window does not close automatically after the script is executed, you do not need to write it.

  1. Next, select File => Save As => in the File name line, write, say, del_obmen.bat, click OK, run and enjoy.

Second example:

"Conscientious" users do not turn off their computers, and go home, and then they hit you in the head for the fact that the computer worked and ate electricity.

  1. Open WordPad.
  2. We write:

Third example:

You have 20 people in your office, there is only one printer and everyone needs to print on it. You can write a batch file, drop it in exchange, go to the office and tell all users go there and there, click this, and you can print, and if you have active directory then can be distributed using it.

  1. Open WordPad.
  2. We write:

start \\ 192.168.0.37 \ SamsungU

Start - start, \\ 192.168.0.37 - ip address, \ SamsungU - printer name.

If your ip addresses are distributed via DHCP, then it is better to enter not the ip address, but the computer name.

Creating a bat file with your own hands

The main commands that are used to write body shirts:

ASSOC - Displays or modifies file extension associations

AT - Schedules commands and programs for execution on the computer.

ATTRIB - Displays or changes file attributes.

BREAK - Sets or cancels combination check.

CACLS - Displays or modifies access control lists (ACLs) for files.

CALL - Calls one * .BAT file from another.

CD - Displays the name or changes the name of the current directory.

CHCP - Displays or sets the active code page number.

CHDIR - Displays the name or changes the name of the current directory.

CHKDSK - Checks the disk and displays a status report.

CLS - Clears the screen.

CMD - Start a new instance of the interpreter Windows commands NT.

COLOR - Sets the default colors for the foreground and background of the console.

COMMAND - Starts a fresh copy of the Windows command interpreter.

COMP - Compares the contents of two files or set files.

COMPACT - Displays or modifies the compression of files on patrician Windows NT (NTFS).

CONVERT - Converts FAT volumes to file format Windows systems NT (NTFS). You cannot convert the current disc.

COPY - Copies one or more files to another place.

CTTY - Changes the terminal device used to control your system.

DATE - Displays or sets the date.

DEL - Deletes one or more files.

DEBUG - Performs debugging, testing programs, and editing tools.

DIR - Displays a list of files and subdirectories in a directory.

DISKCOMP - Compares the contents of two floppies.

DISKCOPY - Copies the contents of one floppy disk to another.

DOSKEY - Edits command lines, repairs Windows commands and creates a macro.

ECHO - Displays messages, or enables / disables command output.

EMM386 - Enables / disables EMM386 extended memory support.

ENDLOCAL - Ends localization of changes the environment in * .BAT file.

ERASE - Deletes one or more files.

EXIT - Terminates the execution of the program "CMD.EXE" (command interpreter).

EXTRACT - Tool for extracting information from CAB files.

FC - Compares two files or file settings and displays the difference between them.

FIND - Searches for a text string in a file or files.

FINDSTR - Search for strings in files.

FOR - Executes the specified command for each file in a set of files.

FORMAT - Formats a disk for use with Windows.

FTYPE - Displays or modifies the file types used in extension links.

GOTO - Directs the Windows NT command interpreter to the marked line in the * .BAT file.

GRAFTABL - The ability of Windows to display pseudo-graphic symbols inserted in graphical mode.

HELP - Provides Help information for Windows commands.

IF - Performs processing of a condition in a * .BAT file.

KEYB - Configures the keyboard for the given language.

LABEL - Creates, modifies, or removes a volume label on a disk.

LOADHIGH (LH) - Loads the program to high memory addresses.

MD - Creates a directory.

MEM - Displays the amount of used and free memory on your system.

MKDIR - Creates a directory.

MODE - Configures the system device.

MORE - Displays output one screen at a time.

MOVE - Moves one or more files from one directory to another on the same disk.

NETSTAT - Displays statistics of protocols and current network connections TCP / IP.

NLSFUNC - Loads country specific information.

PATH - Displays or sets the search path for executable files.

PAUSE - Pauses processing of * .BAT file and displays a message.

POPD - Restores the previous value of the current directory saved by PUSHD.

PRINT - Prints a text file.

PROMPT - Changes the Windows command prompt.

PUSHD - Saves the current directory, then changes.

RD - Removes a directory.

RECOVER - Recovers readable information from a bad or defective disk.

REM - Writes comments (notes) to * .BAT files or CONFIG.SYS.

REN - Rename the file or files.

RENAME - Rename the file or files.

REPLACE - Replaces files.

RESTORE - Restores files that were archived using the BACKUP command.

RMDIR - Removes a directory.

SET - Displays, installs or removes Environment Variables Windows.

SETLOCAL - Starts localizing environment changes in a * .BAT file.

SETVER - Sets the MS-DOS version number that Windows tells the program.

SHIFT - Shifts the position of the replaced parameters in the * .BAT file.

SMARTDRV - Installs and configures the SMART Drive Caching Utility.

SORT - Sorts the input stream.

START - Starts a separate window to execute the specified program or command.

SUBST - Associates a path with a drive letter.

SYS - Copies the MS-DOS system files and command interpreter to the drive you specify.

TIME - Displays or sets the system time.

TITLE - Sets the window title for the "CMD.EXE" session.

TREE - Graphically displays the directory structure of the drive or path.

TYPE - Displays the contents of a text file.

VER - Displays the Windows version.

VERIFY - Tells Windows whether to check whether the files are written to disk correctly.

VOL - Displays the disk volume label and serial number.

XCOPY - Copies files and directory trees.

There is also a very good forum with a bunch of ready-made scripts.