• Windows 7 command line. CMD commands. Command line commands. Command line

    This article will cover the basics Windows command line, namely:

    • Command line concept;
    • Command Reference shell;
    • Sequence of events when executing a command;
    • Creating command line scripts;
    • Controlling the display of text and commands;
    • Commands for studying system information;
    • Commands for using the registry;
    • System services management;
    • Reboot and shutdown systems from the command line;
    • Manage applications and processes from the command line.

    Command Line Concept

    Command line support is built into the operating system Microsoft system Windows and is accessible through a command shell window. Command line is supported on all versions of Windows and is used to run built-in commands, utilities, and scripts. Despite the power and flexibility of the command line, some Windows administrators never use it. If you have enough graphic tools administration, you can only apply them by clicking the user interface elements.

    However, experienced Windows administrators, qualified software specialists technical support and “advanced” users cannot do without the command line. Knowing how to properly use the command line—specifically, which command line tools to choose and how and when to use them so that they work effectively—can help you avoid many problems and ensure smooth execution of your operations. If you support multiple domains or networks, understanding time-saving ways to work with the command line is not only important but necessary to automate daily operations.

    With each new version Windows command the line was improved and its capabilities expanded. The command line has undergone significant changes, associated not only with increased productivity, but also with increased flexibility. Now you can use the Windows command line to solve problems that could not be solved in previous versions Windows.

    Start the Windows command shell environment in different ways, in particular by specifying parameters when starting Cmd.exe or using your own start file stored in the directory %SystemRoot%\System32.

    Additionally, the command line can be run in batch mode to execute a set of commands. In batch mode, the command line reads and executes commands one after another.

    When working with the Windows command line, you need to understand where the commands you use come from. “Native” commands (built into the operating system) come in two types:

    • Domestic– exist inside the command shell, they do not have separate executable files;
    • External- implemented in separate executable files, which are usually stored in the %SystemRoot%\System32 directory.

    Quick reference to shell commands (Cmd.exe)

    • assoc- displays or modifies mappings ( associations) file types;
    • break- sets breakpoints when debugging
    • call- calls a procedure or another script from a script;
    • cd (chdir) - shows the name of the current directory or changes the current directory;
    • cls- clears the command line window and screen buffer;
    • color- sets the text and background colors of the command shell window;
    • sorry- copies files or performs file concatenation;
    • date- shows or sets the current date;
    • del (erase) - deletes a specified file, group of files, or directory;
    • dir- shows a list of subdirectories and files in the current or specified directory;
    • echo- displays text in the command line window or sets whether commands should be displayed on the screen (on|off);
    • endlocal- marks the end of localization ( local scope) variables;
    • exit- exit the command line shell;
    • for- performs given command for each file in the set;
    • ftype Lists or changes current file types in file extension mappings to programs;
    • goto- specifies that the command interpreter should go to the line with the given label in the batch script;
    • if- executes commands according to conditions;
    • md (mkdir)- creates a subdirectory in the current or specified directory;
    • move- moves a file or group of files from the current or specified source directory to the specified directory. Can also rename a directory;
    • path- shows or sets the command path used operating system when searching for executable files and scripts;
    • pause- stops execution batch file and waits for keyboard input;
    • popd- makes current the directory whose name was saved by the PUSHD command;
    • prompt- specifies what text should be shown in the invitation line;
    • pushd- saves the name of the current directory and, if necessary, makes the specified directory current;
    • rd (rmdir)- deletes a directory or a directory along with its subdirectories;
    • rem- marks comments in a batch script or Config.nt;
    • ren (rename)- Renames a file or group of files;
    • set- shows current environment variables or sets temporary variables for the current command shell;
    • setlocal- marks the beginning of localization ( local scope) variables in batch scripts;
    • shift- shifts the position of replaced parameters in batch scripts;
    • start- launches given program or a command in a separate window;
    • time- shows or sets the system time;
    • title- sets the title of the command shell window;
    • type- shows the contents text file;
    • verify- turns on the file verification mode after writing to disk;
    • vol- shows the label and serial number disk volume.

    Any syntax internal team (and most external) can be obtained by entering the command name and /? at the command line, for example:

    Command shell- a very powerful environment for working with commands and scripts. You can run commands on the command line different types: built-in commands, Windows utilities and command line versions of applications. Regardless of the type, every command you use must follow the same syntax rules. According to these rules, the command name is followed by required or optional arguments. Additionally, arguments can use input, output, or standard error redirection.

    Sequence of events when executing a command

    • The command shell replaces any variables entered in the command text with their current values;
    • If a group or chain of several commands is entered, the line is split into individual commands, which in turn are split into the command name and arguments. Next, the commands are processed separately;
    • If a command name specifies a path, the shell looks for the command in that path. If there is no such command in the specified directory, the shell returns an error;
    • If the command name does not include a path, the shell first tries to resolve the command name to internal level. If an internal command with the same name is found, then an internal command has been called and can be executed immediately. If there is no internal command with the same name, the shell first looks for executable file commands in the current directory, and then in the directories listed in the PATH environment variable. If the command file is not in any of these directories, the shell returns an error;
    • If the command is found, it is executed with the given arguments and, if necessary, input is read from the source specified in those arguments. Command output and errors are shown in the Command Prompt window or sent to a specified output and error sink.
    • As you can see, many factors affect command execution, including command paths, I/O redirection, and grouping or chaining of commands.

    When working with a command shell, you probably started it by opening the Start menu ( Start) and selecting Programs ( Programs) or All Programs ( All programs), then Accessories ( Standard) and Command Prompt ( Command line). Other ways to start the command line are the Run dialog box ( Starting the program) or entering cmd in another, already open window command shell. These methods allow you to specify arguments when starting the command line: keys that control the operation of the command line and parameters that initiate execution additional commands. For example, you can start a command shell in silent mode ( i.e. disable echo output) with the cmd /q command or to make the command shell execute the given command and exit - to do this, enter cmd /c, followed by the command text in quotes.

    The following example starts a command shell, runs the ipconfig command, outputs the results to a file, and exits:

    Cmd /c "ipconfig > c:\ipconfig.txt"

    Creating Command Line Scripts

    Command Line Scripts- text files with commands that you want to execute. These are the same commands that you would normally enter in a command prompt. Windows shell. However, instead of typing commands every time you need them, you can script them and make your life easier.

    Since scripts consist of standard text characters, they can be created and edited in any standard text editor, say, in Notepad ( notebook). When entering commands, make sure that each command or group of commands that must be executed together is marked with new line. This will ensure they are executed correctly. When you've finished creating the command line script, save the script file with a .bat or .cmd extension. Both extensions work the same. For example, if you need to create a script to display the system name, Windows version, and IP configuration, include the following three commands in the SysInfo.bat or SysInfo.cmd file:

    Hostname ver ipconfig -all

    Controlling the display of text and commands

    Team ECHO serves two purposes: to write text to output ( for example, to a command shell window or a text file) and to enable/disable command echo display. Typically, when you run script commands, the commands themselves and the output of those commands are displayed in a console window. This is called command echoing ( command echoing).

    To use the ECHO command to display text, type echo followed by the text you want to display:

    Echo The system host name Is: hostname

    To control echoing of commands using ECHO, type echo off or echo on, for example:

    Echo off echo The system host name is: hostname

    To direct output to a file rather than to a shell window, use output redirection, for example:

    Echo off echo The system host name is: > current.txt hostname » current.txt

    Now let's see how command echoing is suppressed. Start a command shell, type echo off, then other commands. You will see that the command prompt is no longer displayed. Instead, only what is typed in the console window and the output of executed commands appears. In scripts, the ECHO OFF command disables command echoing and the command prompt. By adding the ECHO OFF command to your scripts, you prevent your shell window or file from being cluttered with command text if you are only interested in the output from those commands.

    Studying system information

    Often when working with a user's computer or a remote server, there is a need to obtain basic information about the system, such as the name of the user registered in it, the current system time or location specific file. Commands that collect basic system information include:

    • NOW- displays the current system date and time in 24-hour format, for example Sal May 9 12:30:45 2003. Available only in Windows Server 2003 Resource Kit;
    • WHOAMI- reports the name of the user registered in the system on at the moment, for example adatum\administrator;
    • WHERE- searches for files using a search pattern ( search pattern) and returns a list of matching results.

    To use NOW or WHOAMI, simply type the command in the command shell window and press Enter. The most common syntax for WHERE looks like this:

    Where /r base_directory_file_name

    Here the /r parameter is specified for a recursive search starting from the specified directory (base_directory) and including all its subdirectories, and file_name is the full or partial name of the file being searched, which may include wildcards: the ? replaces one character, and the * sign replaces a group of characters, for example data???.txt or data*.*. The following example searches the C:\ directory and all its subdirectories for all text files whose names begin with data.

    Where /r C:\data*.txt

    You can also find files of all types whose names begin with data:

    Where /r C:\data*.*

    Sometimes you need to obtain information about the system configuration or the system environment. On mission-critical systems, this information can be saved or printed for reference. Listed below are commands that allow you to collect information about the system.

    • DRIVERQUERY- displays a list of all installed drivers devices and their properties, including module name, display name ( display name), driver type and build date ( driver link date). All information display mode (/V) reports the status and state of the driver, startup mode, memory usage information, and path to file system. The /V option also enables output detailed information about all unsigned drivers.
    • SYSTEMINFO- provides detailed information about the system configuration, including information about the version, type and manufacturer of the operating system, processor, BIOS version, memory capacity, regional settings, time zone and configuration network adapter.
    • NLSINFO- displays detailed regional information, including default language ( default language), code Windows page, time and number display formats, time zone and installed code pages. This command is only available in the Windows Server 2003 Resource Kit.

    To use these commands on local computer, simply type the name of the desired command in the command shell window and press Enter.

    Commands for using the registry

    The Windows Registry stores configuration information for the operating system, applications, users, and hardware. This data is contained in sections ( keys) and parameters ( values) registry, which are located in a specific root section ( root key), which controls how and when sections and parameters are used.

    If you know the paths to the partitions and understand the allowed data types in the partitions, you can use the command REG to view sections and parameters and manipulate them in a variety of ways. REG supports several subcommands:

    • REG add- adds a new subsection or element to the registry;
    • REG delete- deletes a subsection or element from the registry;
    • REG query- displays a list of section elements and subsection names ( if they exist);
    • REG compare- compares subsections or registry elements;
    • REG I'm sorry- copies a registry element to the specified partition path on a local or remote system;
    • REG restore- writes previously saved subsections, elements and parameters to the registry;
    • REG save- saves a copy of the specified subkeys, elements and registry settings to a file.

    System Services Management

    Services provide key functions workstations and servers. To control system services on local and remote systems, use the service controller command ( service controller command) S.C., which has a set of subcommands, only part of them is described below:

    • SC config- setting up accounts for registering and running services;
    • SC query- display a list of all services configured on the computer;
    • SC qc- displaying the configuration of a specific service;
    • SC start- starting services;
    • SC stop- stopping services;
    • SC pause- suspension of services;
    • SC continue- resumption of services;
    • SC failure- specifying actions to be performed when a service fails;
    • SC qfailure- View actions taken when a service fails.

    You can specify a name in all commands remote computer, whose services you want to work with. To do this, insert the UNC name or IP address of the computer before the subcommand you are using. Here's the syntax:

    Sc ServerName Subcommand

    Reboot and shutdown systems from the command line

    Systems often have to be rebooted or shut down. One way is to use the Shutdown utility for this, which allows you to work with local and remote systems. Another way to control system shutdown or reboot is to assign a shutdown task. Here you can use Schtasks to specify a shutdown time, or create a script with a list of shutdown commands for individual systems.

    The following commands allow you to control the reboot and shutdown of the local system.

    Shutting down the local system:

    Shutdown /s /t Shutdown Delay /1 /f

    Shutdown /r /t Shutdown Delay /1 /f

    Application, process and performance management

    Whenever the operating system or user runs a service, application, or command, Microsoft Windows runs one or more processes to control the associated program. Several command line utilities will make it easier for you to monitor and manage programs. These utilities include:

    • Pmon (Process Resource Manager) - Shows performance statistics, including memory and CPU usage, and a list of all processes running in local system. Allows you to receive detailed " pictures» resources involved and processes performed. Pmon comes with the Windows Resource Kit;
    • Tasklist (Task List) - lists all running processes by name and process ID, reports information about the user session and occupied memory;
    • Taskkill (Task Kill) - stops the execution of a process specified by name or identifier. Using filters, you can stop processes depending on their state, session number, CPU time, memory footprint, user name, and other parameters.

    That's basically all I wanted to tell you about the basics of the Windows command line.

    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 consider basic commands, which users can apply when using the specified 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 available 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. Same as in the previous case, prerequisite is the input along with a command expression of the full path to the object being processed. The following keys are used to set attributes:

    • h– hidden;
    • s– systemic;
    • r– read only;
    • 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- by 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 the file 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 session name, 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 performing a specific task. To obtain detailed information about them, you can use Help using the following command expression:

    NETSTAT– display 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 run 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.

    Command line - special program, which allows you to control the operating system using text commands entered in the application window. Its interface is completely text-based, in contrast to the usual appearance of the operating system.

    Performing actions using text expressions, of course, is not as convenient as clicking on icons on the screen, selecting menu items, opening program windows. But sometimes it is simply necessary to open the command line, for example, in case of problems in the system, working with setting up a network and equipment, calling system applications. Here are some examples of its use:

    1. The systeminfo command allows you to collect information about the system, including installed updates and network information. The graphical interface does not provide for receiving such data.
    2. chkdsk - checks the disk for errors and generates a report.
    3. sfc /scannow - useful command launch scanning and recovery of damaged files.
    4. ipconfig - allows you to find out the IP address of your computer in a split second.
    5. ping - check the network operation in case of problems with the router.
    6. help - the command line will display a list of possible commands with brief information about them.

    These are just a few examples beneficial use this application. In addition, through the program window you can quite successfully work on the computer without using a mouse.

    Switching methods

    There are several options to open the Windows Command Prompt:

    In versions higher than Windows 8, in order to apply this method, you need to click on the magnifying glass next to the user name.


    Also for quick launch you can create a desktop shortcut and hotkeys. You can create a shortcut like this:

    1. In the Explorer window, find the “Windows\System32” folder, right-click on the cmd.exe file in it, then “Create a shortcut” and select a name for it.
    2. Right click on empty space on the screen, find “Create shortcut” in the context menu. In the field that appears, type C:\Windows\System32\cmd.exe. Next, select a name and click OK.

    Now you can assign hotkeys. Call context menu created shortcut, click “Properties”, “Shortcut” tab, enter the required combination in the “Shortcut” field.

    Please note that when launched using the shortcut, search box and explorer, the command line is launched from the System32 folder, and using the "Run" item of the Start menu from Users folders your computer.

    Opening with extended rights

    Among the methods discussed, some allow you to enable the command line as an administrator. The fact is that even if you use the Administrator account in your current work, you do not have full rights to control the system. This is done to improve reliability and reduce the risk of damage from malware.

    The earliest operating systems did not have the usual modern user graphical interface. Previously, computer controls were used exclusively text commands.

    However, today, despite the variety of possibilities that provide easy and convenient communication between the user and the PC, they are still used. There are also operating systems that work only by entering text commands into them. They are commonly used by database administrators, programmers, and other IT professionals.

    An excellent example of controlling the operating system using text commands - team Windows string 7. It is present in any distribution of this OS and can be run on any PC running this operating system. You don't need to be an administrator or any kind of IT specialist to learn how to use it. Let's look at this issue in more detail.

    A little theory and facts

    The Windows command line is a toolkit that allows the user to perform various actions on the operating system or on separate programs by entering text commands. The command line usually consists of a command interpreter (shell) and a text interface. First responsible for transmitting and executing commands operating system, second- provides the user with the opportunity entering these very commands and viewing the result of their execution.

    The command line offers great capabilities for managing the operating system. Almost everything that can be configured in Windows using the mouse can be done through it. This leads to the conclusion that the command line is capable of performing a fairly large list of tasks, each of which is performed in turn entering a unique command. It is precisely because of the need to remember the syntax of these commands and the ability to use them that most ordinary users have difficulty working with the command line.

    Even so, using the command line is not that difficult of a task. The main thing here is to learn to understand the very principle of its operation, which will be discussed in more detail later.

    Why does the average user need the command line?

    Surely, each of you has come across various articles on the Internet in which the authors urge you to use one or another command to solve a certain problem. For example, through the command line you can do file management, stored on any media, change parameters system operation or even create Internet connection. However, the above can be easily accomplished using a regular mouse and keyboard.

    The importance of the command line lies in the fact that any operations with the system can be performed in the event that access to the graphical interface is lost or there is no other solution.

    Here are some examples:

    • Registration in the system dynamic DLLs (often necessary to do when copying to the system Windows folder a new DLL file - registration will “make it clear” to the system that a new library has appeared);
    • Setting up a network adapter computer as wireless point Wi-Fi access;
    • You can even access the Internet by connecting to the network through one of your existing connections.

    You also cannot do without using the command line in case impossibility of control computer using a graphical interface. For example, there is more than one variety virus programs that turn off Windows Explorer without allowing the user to access folders or run programs.

    Using the command line, you can not only launch the application, but also go to any folder in order to work on any files (copying, moving, setting a new name, and so on). And this is only part of the command line capabilities. Let's now move on to practice.

    How to Open Command Prompt in Windows 7

    The first thing you need to do is run the command line, preferably as an administrator.

    It is launched in one of the following ways:


    After performing one of the above actions, you will call the command line - usually this is a small black window.

    Why do you need administrator rights? The fact is that there are a number of teams that are capable of change system settings . You can execute such commands only with administrator rights. This was done for safety. So if you are in account guest, you will not be able to call the command line as an administrator, and therefore not be able to execute commands related to system settings.

    How to use the command line

    Due to the fact that there are enough commands large number, their entire list cannot be displayed in one article. For this reason, we will look at the simplest commands that can be executed without administrator rights. Let's begin.

    After launching the command line, you will see a window similar to this:

    The address line preceding the blinking cursor is the address current folder on your hard drive (or any other connected device). Navigating through folders (changing the current folder) is one of the most simple actions. Let's run this command. To do this, you need to enter the cd command into the window and specify the full path to the name of the folder we need, and then press Enter to start execution. For example, if you need to go to the address " C:\Program Files", to do this, just enter cd C:\”Program Files”

    Important! When navigating to a folder with a space in the name, it must be specified in quotes.

    This way you can go to any directory hard drive. You also need to know that if the folder is located in the current command line folder, then using " CD"it opens without the need to specify the full path ( just specify the folder name after the command).

    To move out of the current folder into a folder more high level, that is parental, use the cd .. command (the two dots mean the parent directory).

    Now let's do it switch to another local disk . To do this, simply specify the drive letters followed by a colon. For example, we want to get to the drive “D:\” - we write the command d: and then press Enter.

    This is done using the command " dir" Enter it and the command line will display a list of the contents of the “D:\” drive. Team " dir" can be called from any folder - even to view the contents of a directory on another drive (to do this, you must enter the full path to the name desired folder). For example, run: dir c:\windows

    Let's look at another command - “ copy" As the name implies, it is used to copy data. For example, you are on the drive " D:\" and you need to copy the file " 1.txt"to a flash drive. To do this, enter copy 1.txt F: Instead of “F:”, you can specify any other drive letter (in our case, copy to drive “C” :\ "") or the full path to the directory where you want to copy files or folders.

    A more advanced version of the copy command is the " robocopy", unlike its predecessor, it can copy not only files, but also folders, including their contents.

    You don't have to remember the names of all the commands. For withdrawal full list With brief description type: help

    To receive detailed information, for example, for robocopy, type: help robocopy

    note that help displays all descriptions on Russian language, of course, if Windows version yours is Russified.

    Everything discussed here is only a small part of the command line capabilities. If you are interested in using it, we recommend visiting the official Microsoft website, where there is full information on working with her.

    Video on the topic

    At a time when everyone uses a graphical interface, the regular command line (console) is still relevant. This is the ancestor of the human-computer communication interface. In this article I will tell you what it is and in what ways the Windows 7/10 command line is launched.

    The console is one of the types of text interface that became available to a wide range of users along with the MS DOS operating system. The essence of working with this type of interface is that all commands are executed by entering them from the keyboard.

    Most people consider the command line to be a relic of the past that should have gone into oblivion along with the command line itself. DOS system. After all, graphic Windows interface much more convenient, visual and understandable for most people. But do not forget that the command line is not DOS, although the external similarity is certainly present - the same black window with a blinking cursor.

    The console remains an indispensable management method, the need to use which may often arise not only for the system administrator, but also for the average user.

    A short video on how to launch the command line and how to execute commands:

    Running the command line

    Despite the fact that the user sees everything graphically, the console has been and remains one of the main elements of computer control. Of course, the average user does not need to know commands at the level of an IT specialist, but the basics of management will be useful to everyone.

    To start the command line you need to go to the menu “Start -> Run”, write the word “cmd” in the window and press “Enter”. In Windows 8/10 (or if there is no Run menu item), press the key combination “Win ​​+ R”.

    By the way, for the “Run” option to appear in Windows, you need to right-click on the button “Start -> Properties -> Customize” and check the box:

    Open the console with admin rights

    Sometimes you need to open a command prompt as an administrator. This is necessary to execute commands that require elevated access rights to the system. To do this, in the search bar of the Start menu, write “cmd” and in the search results, right-click on the found “cmd” program and select “Run as administrator”

    In Windows 10 they made it a little easier, you need to right-click on the “Start” menu and select “Command Prompt (Admin)”

    If necessary, the console can be found at standard address "C:\Windows\System32\cmd.exe" and call her from there to normal mode, or through the right button with administrator rights. You can create a shortcut for yourself on your desktop by simply dragging it from the menu “Start -> Accessories -> Command Prompt”. By the way, the “Run” input field is also a command line.

    To open the console every time with administrator rights, you need to:

    • click on the shortcut, select “Properties”
    • On the “Shortcut” tab, click the “Advanced” button
    • check the box “Run as administrator”

    Here is the console itself. As you can see, there is nothing superfluous, everything is done quite ascetically. In the window you can see the usual “copyright” sign, indicating that the software belongs to Microsoft, below is the current directory and a cursor indicating readiness to start working:

    The appearance can be given some changes to make it more suitable for a particular user. This can be done by right-clicking on the window title and selecting “Properties”. There you can customize colors, font, layout and some other appearance parameters:

    How to copy and paste text

    The developers screwed us over because the standard “Ctrl+C/V” and “Ctrl/Shift+Insert” buttons do not work in Windows XP/7. To copy text you need:

    • right click on the window
    • select “Mark”
    • select text with left mouse button
    • right click mouse

    And to paste text from the clipboard into the console window, you need to right-click and select “Paste.” But there are two options in the Properties window:

    If you check the “Select with mouse” checkbox, then we can immediately select text with the mouse, without selecting the “Mark” item, and we will simply insert text by clicking the right button. If you uncheck the “Quick Paste” checkbox, the text will be inserted on top of the existing one without moving it to the right. In Windows 10, this all already works by default.

    Buttons for working on the command line

    For more comfortable work with the console, you can use the following hotkeys:

    • The Up/Down arrows help you navigate through the history of entered commands;
    • – enter the last command letter by letter;
    • – output of the previous command;
    • – displaying a numbered list of commands (usually the system remembers the last 50 commands, although it can be configured differently);
    • — moving the cursor to the beginning/end of the line;
    • — move back/forward one word;
    • — switching between insert and rewrite modes (as in Word);
    • — delete the entered text.

    Read which ones in a separate article.