What the cmd command will call. All Windows command line commands in one place

Most users personal computers do not face the need to use any CMD command. Many people simply lack the functions provided by the visual shell of the operating system. However, there are situations when you have to manipulate the system directly, and that’s when the command line comes to the rescue.

What is the command line

This software, which is part of the standard programs of the system. CMD provides the user with the ability to work with the system and files directly. The application has a text interface, and the execution result is displayed on the screen. Simply put, the command line translates user requests into a form that the system can understand. Externally, of course, the program looks like simple user not very familiar, but at the same time it has a number of positive properties, and besides, it is faster than the visual component. built into every version of the Windows operating system.

Ways to launch the command line

The operating system developers have provided several options for launching CMD:

  • Go to the Start menu / Accessories / then select “Command Prompt” from the list.
  • Go to the Start menu, select "Run", in the window that appears, enter CMD.exe in the line. You can also open the Run window using the Win+R key combination.
  • Go to the system folder C:\Windows\system32 and select the CMD.exe program.

Most of the most important commands can be obtained using the Help command. After entering of this request Windows CMD commands will appear with information on how to use them. All of them can be divided into several fairly broad groups. Their division occurs according to the principle of application. For example, CMD commands to run the commands used. The most common of them will be presented below. They are also the most necessary CMD line commands.

Basic commands for working with system directories

This list of commands will be useful if you need to access folders located on the system:

  • Dir - provides the ability to view folders as a list. Using additional criteria command line You can sort directories according to a number of parameters.
  • RD - provides the ability to delete an unnecessary directory. With additional parameters, you can set deletion criteria: for example, delete several folders at once.
  • MD - the command creates a new folder (directory). Various options allow you to create different types of directories.
  • CD - provides the ability to move from one directory to another, in some cases you will need to use quotes.
  • XCopy - used to copy folders without changing their structure. Unlike Copy, this one has more advanced command capabilities. Via CMD, you can perform fairly flexible operations with this request.
  • Tree - provides the ability to display directories in graphical form. By default, the display is done using pseudographics.
  • Move - used to both move and change the directory name. The command makes it possible to move several folders at a time.

Basic commands for working with files

These CMD file commands can be useful to many personal computer users:

  • del - command used to delete. Can be used to delete one or several files. In addition, there is an option to delete read-only files;
  • edit - the command launches a text editor;
  • ren - allows you to rename a file. You can also use rename;
  • move - used to move and rename a file;
  • copy con - allows you to create a new file;
  • fc - allows you to compare what is in two files. The result of the work is the appearance of symbols that provide information about the status of the comparison;
  • type - applicable for text documents. The execution of the command is to display the contents of the file on the screen;
  • copy - allows you to copy and also merge files.

Commands for diagnosing the hard drive of the computer and system

In addition to all the above advantages, CMD commands allow you to check for errors in operation hard drives or change volume labels, as well as defragmentation.

  • Compact - the command allows you to display and configure compression in the NTFS file system. Using this command you can significantly save disk space.
  • Format - formats a disk or floppy disk. Please note that formatting will result in complete removal all data on the media.
  • Chkdisk - checks and displays information about the media. The team will help you find out about the occupied space, the amount of space on bad sectors, and so on.
  • Fsutil - provides information about the file system and allows you to make changes to it.
  • Chkntfs - allows you to show and configure during Windows startup.
  • Convert - allows you to convert a volume from one file system to another. It is not possible to change the type of the active volume or disk.
  • Recover - a command for recovering data from damaged media. This process occurs by reading one sector after another. Reading occurs only from those sectors from which it is possible to read. Data located in physically damaged sectors will not be recovered. Most often it is restored in this way text documents from damaged floppy disks.
  • Diskpart - allows you to open disk data and make the required settings.
  • Vol - provides information about the serial number of the hard drive.
  • Label - used to view and edit volume labels. Please note that the volume name can contain no more than 11 characters, and NTFS 32 characters.

Information commands

This type of command will help you obtain information about versions, configurations, as well as installed drivers:

  • ver - provides information about the system version using the CMD command, Windows 7 also supports this request;
  • driverquery - allows you to view information about installed drivers; The display can be in the form of a list, table or CSV;
  • systeminfo - Provides information about system configurations. Configurations can be viewed both locally and in addition, the command provides properties about service packs.

processes and applications

Commands for managing and changing operating system settings:

  • shutdown - the command is used to shut down, restart or put the computer into sleep mode. If the user has the necessary rights, it is possible to carry out settings remotely;
  • time - used to display and change the current time;
  • date - used to display and change the current date;
  • tasklist - provides the user with a list of processes currently running on a local or remote personal computer;
  • schtasks - allows you to create, configure or delete scheduled tasks in the operating system. In the graphical interface, the command is represented by the Task Scheduler program;
  • taskkill - used to terminate processes using identifiers or names executable files. The tool began to be used with Windows XP.

Commands to customize the command line

This group of commands relates directly to setting up the CMD. Commands will help you clear the screen and change it appearance and so on:

  • Exit - allows you to close batch data or close the command line altogether.
  • Color - provides the ability to change the background or font color in the command line window. The color is specified as a hexadecimal digit. The most significant bit indicates brightness, and the subsequent bits indicate color. The default is white letters on a black background.
  • Title - allows you to change the name of the CMD.exe window.
  • CMD - allows you to launch a new command interpreter window Windows strings. Usually the need for this command occurs when you want to predefine the actual CMD settings.
  • Prompt - allows you to change the command line greeting. If you use the command without parameters, the prompt text will look like: current drive, directory and the greater-than symbol.

Network CMD commands

Most users rarely need these queries, but professionals believe that these codes are very helpful when working with a computer:

  • getmac - command provides information about hardware addresses network adapters. In this case, you can find out both local and remote addresses;
  • netsh.exe - the command opens another line. Using it, you can configure the network if necessary. Many experienced users find this program indispensable. To get help about commands, you must write it with a question mark;
  • ipconfig - allows you to obtain information about protocol settings. Sometimes the command allows you to update data in automatic mode. Older operating systems may not support this CMD command;
  • nbtstat - the main purpose of the command is to display NetBt information. in addition, names and contents are displayed;
  • netstat.exe - This command displays information about connections. The output data allows you to see all the information related to

It is worth remembering that, in addition to these network commands, there are some more that will help simplify the work of users. It should be remembered that these commands should only be used when you are confident in the action being performed. Improper use of CMD commands can lead to serious problems in the operation of your personal computer.

List of useful commands

In addition to the above commands, there are a huge number of others:

  • break - the command allows you to enable processing of the CTRL+C keys;
  • debug - launches a tool for debugging and other changes to software products;
  • devcon - the command launches a tool alternative to the task manager;
  • exe2bin - the command converts exe format applications to binary format;
  • hostname - provides the ability to obtain the computer name;
  • logoff - the command shuts down the Windows system.

All the given CMD commands will simplify the work with some software. The main thing is not to try to use requests for purposes other than their intended purpose, in order to avoid losses important information and other undesirable consequences.

In Windows 7, there are operations that are impossible or difficult to perform through normal GUI, but they can really be implemented through the “Command Line” interface using the CMD.EXE interpreter. Let's look at the basic commands that users can use when using this tool.

Using commands in the Command Prompt, you launch various utilities and perform certain operations. Often the main command expression is used together with a number of attributes, which are written separated by a slash ( / ). It is these attributes that initiate the execution of specific operations.

We do not set ourselves the goal of describing absolutely all the commands used when using the CMD.EXE tool. To do this, I would have to write more than one article. We will try to fit information about the most useful and popular command expressions on one page, dividing them into groups.

Launching system utilities

First of all, let's look at the expressions that are responsible for launching important system utilities.

CHKDSK– launches the Check Disk utility, which performs . This command expression can be entered with additional attributes, which, in turn, trigger the execution of certain operations:

  • /f– disk recovery in case of detection of logical errors;
  • /r– restoration of drive sectors in case of detection of physical damage;
  • /x– disconnecting the specified hard drive;
  • /scan– proactive scanning;
  • C:, D:, E: …- indication logical drives for scanning;
  • /? – call up help about the operation of the Check Disk utility.

SFC– launch the utility. This command expression is most often used with the attribute /scannow. It runs a tool that checks OS files for compliance with standards. In case of damage, if you have an installation disk, it is possible to restore the integrity of system objects.

Working with files and folders

The next group of expressions is designed to work with files and folders.

APPEND– opening files in a user-specified folder as if they were in the required directory. A prerequisite is to indicate the path to the folder to which the action will be applied. The recording is made according to the following template:

append [;] [[computer drive:]path[;...]]

When using this command, you can apply the following attributes:

  • /e– recording a complete list of files;
  • /? – launch help.

ATTRIB– the command is intended to change the attributes of files or folders. Just as in the previous case, a prerequisite is to enter, along with a command expression, the full path to the object being processed. The following keys are used to set attributes:

  • h– hidden;
  • s– systemic;
  • r- only for reading;
  • a– archival.

In order to apply or disable an attribute, the sign is placed in front of the key accordingly «+» or «-» .

COPY– used to copy files and directories from one directory to another. When using the command, be sure to indicate the full path of the copy object and the folder into which it will be performed. The following attributes can be used with this command expression:

  • /v– checking the correctness of copying;
  • /z– copying objects from the network;
  • /y– rewriting the final object if the names match without confirmation;
  • /? – activation of help.

DEL– deleting files from the specified directory. The command expression allows for the use of a number of attributes:

  • /p– enabling a request to confirm deletion before manipulating each object;
  • /q– disable the request when deleting;
  • /s– deleting objects in directories and subdirectories;
  • /a:— deleting objects with the specified attributes, which are assigned using the same keys as when using the command ATTRIB.

R.D.– is analogous to the previous command expression, but deletes not files, but folders in the specified directory. When used, the same attributes can be applied.

DIR– displays a list of all subdirectories and files that are located in the specified directory. The following attributes are used along with the main expression:

  • /q– obtaining information about the owner of the file;
  • /s– displaying a list of files from the specified directory;
  • /w– displaying a list in several columns;
  • /o– sorting the list of displayed objects ( e- by extension; n- by name; d- by date; s- to size);
  • /d– display a list in several columns with sorting by these columns;
  • /b– display only file names;
  • /a– displays objects with certain attributes, which are specified using the same keys as when using the ATTRIB command.

REN– used to rename directories and files. The path to the object and its new name are specified as arguments to this command. For example, to rename the file file.txt, which is located in the folder "Folder" located in the root directory of the disk D, in the file file2.txt, you need to enter the following expression:

REN D:\folder\file.txt file2.txt

M.D.– is intended for creating a new folder. In the command syntax, you must specify the drive on which the new directory will be located, and the directory where it will be located if it is nested. For example, to create a directory folderN, which is located in the directory folder on disk E, you should enter the following expression:

md E:\folder\folderN

Working with text files

The next block of commands is designed to work with text.

TYPE– displays the contents of text files on the screen. The required arguments to this command are the full path to the object whose text should be viewed. For example, to view the contents of file.txt located in the folder "Folder" on disk D, you need to enter the following command expression:

TYPE D:\folder\file.txt

PRINT– prints the contents of a text file. The syntax of this command is similar to the previous one, but instead of displaying text on the screen, it is printed.

FIND– searches for a text string in files. Along with this command, the path to the object in which the search is performed must be indicated, as well as the name of the searched string, enclosed in quotation marks. In addition, the following attributes apply with this expression:

  • /c– displays the total number of lines containing the searched expression;
  • /v– output lines that do not contain the search expression;
  • /I– case insensitive search.

Working with accounts

Using the command line, you can view and manage information about system users.

FINGER– displaying information about users registered in the operating system. The required argument of this command is the name of the user about whom you want to obtain data. Alternatively, you can use the attribute /i. In this case, the information will be displayed in a list format.

TSCON– attaches a user session to a terminal session. When using this command, you must specify the session ID or its name, as well as the password of the user to whom it belongs. The password should be specified after the attribute /PASSWORD.

Working with Processes

The next block of commands is designed to control processes on the computer.

QPROCESS– provision of information about running processes on PC. The information displayed will include the name of the process, the name of the user who launched it, the name of the session, ID and PID.

TASKKILL– used to terminate processes. The required argument is the name of the element that needs to be stopped. It is indicated after the attribute /IM. You can also terminate not by name, but by process ID. In this case the attribute is used /PID.

Networking

Using the command line, it is possible to manage various network activities.

GETMAC– starts displaying the MAC address connected to the computer network card. If there are several adapters, all their addresses are displayed.

NETSH– initiates the launch of the utility of the same name, which is used to display information about network parameters and change them. This command, due to its very broad functionality, has a huge number of attributes, each of which is responsible for executing specific task. For getting detailed information You can get help about them by using the following command expression:

NETSTAT– displaying statistical information about network connections.

Other commands

There are also a number of other command expressions used when using CMD.EXE that cannot be separated into separate groups.

TIME– viewing and setting the PC system time. When you enter this command expression, the current time is displayed on the screen, which can be changed to any other time in the very bottom line.

DATE– the syntax command is completely similar to the previous one, but is used not to display and change the time, but to launch these procedures in relation to the date.

SHUTDOWN– turns off the computer. This expression can be used both locally and remotely.

BREAK– disable or start the button combination processing mode Ctrl+C.

ECHO– displays text messages and is used to switch their display modes.

This is far from full list all commands that are used when using the CMD.EXE interface. Nevertheless, we tried to reveal the names, as well as briefly describe the syntax and main functions of the most popular ones, for convenience, dividing them into groups by purpose.

Team HELP allows you to obtain reference information about the most common operating systems Oh Windows family teams. Help information is displayed as for internal teams command processor (IF, GOTO, etc.), and for standard command line utilities (BCDEDIT, CHKDSK, etc.). To get help on a specific command, use the command line:

HELP command

HELP IF- display help information about using the command IF
HELP assoc > C:\assochlp.txt- display help information about using the command assoc with results displayed in text file C:\assochlp.txt

Team HELP without parameters, displays a list of commands supported in this version of the operating system. For example for Windows 7:

ASSOC- Display or change mappings based on file name extensions.

ATTRIB- Display and change file attributes.

BREAK- Turn on and off the CTRL+C key combination processing mode.

BCDEDIT- Sets properties in the boot database to control the initial boot.

CACLS- Display and edit access control lists (ACLs) for files.

CALL- Calling one batch file from another.

CD

CHCP- Display or set the active code page.

CHDIR- Display the name or change the current folder.

CHKDSK- Checking the disk and displaying statistics.

CHKNTFS- Display or change whether disk check is performed during boot.

CLS- Screen cleaning.

CMD- Launch another Windows command line interpreter.

COLOR- Set default foreground and background colors.

COMP- Compare the contents of two files or two sets of files.

COMPACT- Display and change file compression on NTFS partitions.

CONVERT- Convert FAT disk volumes to NTFS. The currently active drive cannot be converted.

COPY- Copy one or more files to another location.

DATE- Display or set the current date.

DEL

DIR- Display a list of files and subfolders from a specified folder.

DISKCOMP- Comparison of the contents of two floppy disks.

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

DISKPART- Display and configure disk partition properties.

DOSKEY- Editing and re-calling command lines; creating macros.

DRIVERQUERY- Displays the current status and properties of the device driver.

ECHO- Display messages and switch the display mode of commands on the screen.

ENDLOCAL- End of local environment changes for batch file.

ERASE- Delete one or more files.

EXIT- Shutting down the CMD.EXE program (command line interpreter).

F.C.- Compare two files or two sets of files and display the differences between them.

FIND- Search for a text string in one or more files.

FINDSTR- Search for strings in files.

FOR- Run the specified command for each of the files in the set.

FORMAT- Formatting the disk to work with Windows.

FSUTIL- Display and configure file system properties.

FTYPE- Display or change the file types used when matching by file name extensions.

GOTO- Transfer control to the marked line of the batch file.

GPRESULT- Display information about group policy for a computer or user.

GRAFTABL- Allows Windows to display extended characters in graphics mode.

HELP- Displays help information about Windows commands.

ICACLS- Display, modify, archive or restore ACLs for files and directories.

IF- Operator for conditional execution of commands in a batch file.

LABEL- Create, change and delete volume labels for disks.

M.D.- Create a folder.

MKDIR- Create a folder.

MKLINK- Creating symbolic and hard links

MODE- Configuring system devices.

MORE- Sequential data output in parts the size of one screen.

MOVE- Move one or more files from one folder to another.

OPENFILES- Display files opened on a shared folder by a remote user.

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

PAUSE- Pauses the execution of the batch file and displays a message.

POPD- Restores the previous active folder value saved using the PUSHD command.

PRINT- Prints the contents of a text file.

PROMPT- Changes the prompt in the Windows command line.

PUSHD- Saves the active folder value and moves to another folder.

R.D.- Deletes a folder.

RECOVER- Recovers readable data from a bad or damaged disk.

R.E.M.- Places comments in batch files and the CONFIG.SYS file.

REN

RENAME- Renames files or folders.

REPLACE- Replaces files.

RMDIR- Deleting a folder.

ROBOCOPY- Improved tool for copying files and directory trees.

SET- Shows, sets and removes Windows environment variables.

SETLOCAL- Starts localizing environment changes into a batch file.

S.C.- Displays and configures services (background processes).

SCHTASKS- Executes commands and runs programs according to schedule.

SHIFT- Changing the position (shift) of substituted parameters for a batch file.

SHUTDOWN- Local or remote shutdown of the computer.

SORT- Sorting input.

START- Execute a program or command in a separate window.

SUBST- Assigning a disk name to a given path.

SYSTEMINFO- Display information about the system and computer configuration.

TASKLIST- Displays all running tasks, including services.

TASKKILL- Termination or stop of a process or application.

TIME- Display and set the system time.

TITLE- Assigning a window title for the current session of the CMD.EXE command line interpreter.

TREE - Graphic display disk or folder directory structures.

TYPE- Display the contents of text files.

VER- Display information about Windows versions.

VERIFY- Setting the mode for checking the correctness of writing files to disk.

VOL- Output label and serial number disk volumes.

XCOPY- Copying files and directory trees.

WMIC- Display WMI information in an interactive environment.

To output the list to a text file, you can use command output redirection:

HELP > myhelp.txt

The list contains the most common commands, most of which are present in all operating systems of the Windows family (TIME, DATE, COPY...). Some of the commands are built-in commands CMD.EXE(REM, COLOR, etc.), but most are command line utilities included in standard distributions. The list obtained using HELP does not contain even half of the commands that are included in modern versions operating systems of the Windows family. When you try to use HELP to get reference information on a command not supported by it, for example help reagentc, the message is displayed:

This command is not supported. Use the "reagentc /?" parameter.

That is, in addition to the team HELP it is possible to obtain help information using a command line parameter /? or -? :

reagentc/?- display a hint on using the environment configuration command Windows recovery REAGENTC, which is not supported by HELP help.

Until the moment when operating systems learned to “communicate” with users using the graphic images familiar to us, information was entered and output into the computer exclusively using text.

Of course, there are still operating systems that use the so-called interface to communicate with users command line. But they are usually used by professional programmers, system administrators and other IT industry workers. For ordinary users, operating system manufacturers have created a convenient graphical interface that allows you to “communicate” with a computer or, say, a smartphone using a mouse or pressing buttons on the screen.

Despite this, every operating system (including Windows XP, 7, 8, etc.) still supports input and output of information via text commands. The Windows Command Prompt is a clear example of this. Let's figure out what it is.

What is the command line

First of all, this is a program cmd.exe, located in the system32 directory of the operating system folder. Possible location: C:\Windows\system32\cmd.exe. The path may differ depending on the version of Windows and where it is installed.

In general terms, the command line is operating system tool, usually consisting of an OS shell and a text interface. The shell provides the user with tools for " communication"with the operating system, which, in this case, are text commands.

Operating command line Windows systems, starting with XP, is designed to provide users with the ability to use MS-DOS and many other computer commands. Its important feature is that it is capable of performing custom commands without GUI. The need to understand and know all of these commands makes it difficult for ordinary users to use the command line to manage the operating system. However, this is not as difficult as it seems at first glance.

Understanding the basic principles of the command line, any user who is more or less familiar with the computer will be able to operate the command line without much difficulty.

In what situations can the command line be useful?

There are a number of reasons to use the command line. There are also situations in which it is simply impossible to do without its use. And in some cases, performing certain Windows functions, as well as setting up the operating system through the command line, is more convenient and faster.

Let's take the situation with viruses. There are virus programs that completely block the graphical interface user (so-called SMS banners). As a rule, these viruses display a window on the computer screen in which a message is written, such as “ Your computer is blocked by the Ministry of Internal Affairs" or " Your data is at risk" and so on. Such SMS banners cannot be closed by any conventional means - neither with the mouse nor with the help of hot keys on the keyboard.

In such situations, the command line comes to the rescue. Of course, in order to call it, you need to do certain actions with the computer, but that’s not about that now.

Another situation. Let's say Windows XP (or any other version) just stopped working, and there is important data left on the hard drive that urgently needs to be copied to a flash drive. If you have at least one handy installation disk from Windows, then on at a certain point installation of the operating system (without waiting for the installation to complete) you can call the command line and copy this data. This feature often comes in handy in the case of a damaged disk, when, for example, Windows installation stops during copying installation files to the hard drive.

The command line is also capable of quickly calling various standard master tuners operating system (for example, Network Setup Wizard) or system tools such as Registry Editor, Component Services, and others. It can also be used to produce direct settings of various parameters Windows, manage files, run programs and perform many other actions.

How to use the command line

On various computer forums and websites you can find hundreds of guides on using certain programs, performing some system settings, and a lot of other articles in which the authors call for using the command line. Many inexperienced users are immediately lost when they see the phrase “ Launch command line..." If you are also one of them, it will be very useful for you to become familiar with the operation of this useful tool. Let's start with how to call it.

How to open the command line

From Windows XP to latest version this family of operating systems, the command line is called through the dialog " Execute» (« Run"), in which you need to enter the command - " cmd" This dialog is launched by simultaneously pressing the Win keys + R:

In Windows XP (unlike subsequent versions) in the menu " Start"There is a special shortcut called " Execute..." If you click on it, the dialogue will also start.

You can call the command line in other ways. Here they are:

Performing one of the above actions will launch a black window with a blinking cursor - this is the command line. Let's look at how to work with it.

IN . Just like in 10, about the features of which you can find out in more detail.

Working on the command line

To " cmd"executed this or that command, just enter it into the window and then press the Enter key. To check you can enter " help" - this command will display a list of all available standard commands.

As you may have noticed, there are many of them. However, these are not all the commands that can be executed using the command line. There are many various programs, which can also be controlled through this console. Basically, " cmd" is expandable shell, which indicates the possibility of adding more and more new commands to the list of actions it performs.

You also need to know that most commands can only be executed if you enter additional mandatory parameters, others support keys (optional parameters). Let's try using the command line to perform some actions on files and folders in which exactly these commands will be used.

Let's try to move from one local drive to another, look at its contents, then create a folder, go to it, and create another folder in it and delete it. Interesting problem? The main thing is that to perform each individual action you will need to use different commands. Let's begin.

After launching the command line, you might notice the address in front of the blinking cursor: “ C:/Users/Username"(in our case - here " Reptile"). The name of the last folder means your current location (the same as if you had accessed this folder via Conductor). And "C:\" is local disk, which you are on. To change the current local drive, just enter its letter and a colon immediately after it - for example, “D:”.

This will take you to the “D:\” drive (or any other). To view disk contents(or any folders) the command " dir" Enter it right here and you will see a list of files and folders available on the “D:\” drive.

Now let's create a folder right at the root of the disk. To do this we use the command - “ mkdir", and as a parameter, separated by a space, you need to enter the name of the future folder, for example, " mkdir xp" In this case, a folder will be created with the name " xp».

After it is created, you can log into your disk through Explorer and make sure that the folder has been created. Now let's go into it.

To go to a particular folder, use the command " CD" Here the name of the directory to go to is also used as an argument. Let's enter " cd xp" and get inside the folder ( make this folder current).

Let's create another one in the folder using the command " mkdir" Let this be the folder " 123 ».

Now delete her. To do this, enter “ rmdir 123" Execute now in the directory " xp» command « dir" and you will see that the folders " 123 " no more.

If you want to learn more about the description of a particular command, simply enter the key “/?” immediately after the command, and a hint will be displayed on the screen. For example, enter " dir/?" Another option to launch the prompt: " help dir».

It’s not easy to remember all the existing commands - there are a huge number of them. The official Microsoft website has the most complete guide on the command line, although the descriptions produced by the command help quite enough.

Video on the topic