• Learning the Windows command line. Command Line Commands Every Windows User Should Know

    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.

    The command line of Windows operating 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 an installation disk with Windows at hand, then at a certain point in the 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 while copying installation files to the hard disk.

    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

    Starting with Windows XP and up to the latest version of this family of operating systems, the command line is called through the “ 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 different programs that 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 may have noticed 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 the local drive 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 comprehensive guide to the command line, although the descriptions produced by the command help quite enough.

    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, destined to fade into oblivion along with DOS itself. After all, the Windows graphical interface is 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 the standard address "C:\Windows\System32\cmd.exe" and call it from there in 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.

    Often in the description of a solution to any problem in Windows 7, there is a mention of the command line. What is this? This is the name of the system shell that lacks a graphical interface. User interaction with it is carried out by entering queries (commands).

    Functions

    There are a huge number of functions for it. Using the command line, you can perform any standard PC setup, check the system status, and display the configuration. It can completely replace the graphical interface. And at the same time, its capabilities are wider than those available in the standard Windows shell.

    But most users still care about the graphical interface. Therefore, you should resort to working with the terminal as a last resort, when there are no alternative solutions to problems. Now let's take a closer look at simple ways to launch it and useful commands.

    Launch

    You can come up with a large number of ways to launch the command line in Windows 7, since the system allows it. But there are three easy options for the average user: in the dialog box "Run", via menu "Start" and through the executable file.

    Method 1: Run Dialog Box

    Dialog box "Run" is a partial replacement for Windows Terminal. Some commands are similar for them. However, it can also be used to launch the command line.

    The easiest way to launch this utility is by simultaneously pressing Win + R. But you can also find it in the menu "Start", chapter "Standard". Enter cmd and click on the button "OK", after which the desired program will start.

    Note: the command line opened in this way has limited functionality, since it is only granted user access. Accordingly, some actions will not be available. To unlock them, you need to enable them as an administrator.

    Method 2: Start Menu

    Menu "Start" designed to quickly call various system elements. Launch it, go to "All programs", open the section there "Standard". It will contain a shortcut to activate the command line.

    Attention: unlike the previous option, in this case it is possible to launch the terminal with administrator rights. To do this, right-click on the desired element and select the second item.

    Method 3: Executable file

    Both previous methods were associated with indirect options for opening the terminal. But it can also be launched directly, through an executable file. His name is cmd.exe, located on the system drive, along the path Windows/System32.

    An alternative access option is to search in Explorer. You can also find the element "Command line" in Start, right-click on it, select "Properties", and then "File location".

    For executable filecmd.exe, you can create a shortcut, for example, on your desktop. This will make starting the console much easier in the future. Right-click on the document, select "Send - Desktop...". In this case, you can automatically launch the command line with administrator rights. To do this, open the shortcut properties, go to the section "Compatibility" and check the box next to the appropriate item.

    Teams

    Request help will display everything teamsWindows 7, available for input at the moment. For most of them, parameters or values ​​can be set. We will consider those queries that may be useful to the average user.

    PC shutdown timer

    Team shutdown is responsible for turning off the computer. It has the following attributes:

    • -s - turns off the PC immediately after entering.
    • -s -t 50 - turns off the PC after a certain time (50 is the number of seconds, the number can be changed to any).
    • -a - cancel the shutdown timer.

    The specified attributes are written with a space after the command. It looks like this: “request attribute”. For example, to turn off the PC after 3 minutes you need to enter the following:

    shutdown -s -t 180

    Displaying computer configuration

    Computer configuration information can be obtained through systeminfo.
    It will display the status of network connections, installed amount of RAM, applied updates and other information.

    Disk check

    Team chkdsk causes the state of the logical disk partitions. And using it with the following attributes will perform the check:


    Checking system components

    To call this function, use the request sfc. It allows you to check the condition of system components and restore them if damage is detected. This is a useful command that is often required when fixing executable file errors.

    It starts with the following attributes:

    • /scannow - immediately starts the scanning procedure.
    • /scanonce - assigns a scan to reboot the PC.
    • /scanboot - scanning is always enabled when Windows boots.

    For many PC users, working with the command line seems like an incomprehensible archaism left over from the days of DOS, but for initiates, this “secret knowledge” remains an indispensable tool that provides access to powerful hidden options and tools of the operating system. I present to you more than 30 secrets Windows command line.

    In order to launch the command line in Windows 7, you need to go to the menu Start - All Programs - Accessories - Command Prompt, right-click on it and select Run as administrator and then confirm your intentions in the Account Control service window:

    What opportunities does this open to us? Below are more than 30 secret options

    1. File system conversion

    Team: convert

    It's still on your hard drive. legacy FAT32 file system? This means you can't store files on it more volume 4 GB. To find out which file system is used you need to go to My computer and right-click on the local disk icon and select Properties. In the window that opens, we will see which file system is used:

    If we see the inscription “FAT 32”, then it makes sense to convert the file system to NTFS. This can be done without losing data. Remember which drive letter is assigned to the drive, open the console, then enter the command "convert f: /fs:ntfs", Where "f:"— drive letter that needs to be converted:

    And press the key.

    2. Identifying “battery hogs”

    Team: powercfg /energy

    Laptop battery drains after an hour of use? To check if any program that loads the central processor is to blame for this, type in the console "powercfg/energy" and press Enter. Within a minute, Windows will analyze the situation and generate a report on the results. To view it, type in the console "energy-report.html" and press . Now you can easily detect the processes that require the most system resources:

    Now you can easily discover the processes that require the most system resources. You can find them by title "CPU Usage:". The process name will be indicated below, in our case - firefox.exe. If there are applications that require a lot of system resources and you don't need them at the moment, just end them.

    3. Optimization of electricity consumption

    What irritates you is that at the slightest pause in work the screen goes blank Or is your laptop battery draining too quickly? All settings related to energy consumption can be changed in the dialog box Power options.

    Team: powercfg.cpl

    Healthy: In the advanced power settings, you can tell the system what should happen when you connect your laptop to the network or when you close its lid. For example, you can prevent Windows from going into sleep mode.

    4. Performance monitoring

    Team: perfmon /res

    This command runs Resource Monitor. Here you can see in detail how much running programs load the system and find out some useful information. For example, if you need to find out why your hard drive starts making noise from time to time, go to the "Disk" and then open the section "Processes with disk activity". After that, click on the column "Total (bytes/s)" so that the largest value is in the first row of the list. This way you can identify the program that uses the drive more actively than others. In our case, it turned out to be an antivirus.

    5. Disabling unnecessary programs

    Team: services.msc

    In normal mode, dozens of small auxiliary system services automatically start along with Windows. Some of them can be safely disabled, since they perform very exotic functions that few people need. Team services.msc opens a dialog box with a complete list of system services. Now all that remains is to decide which services will automatically start along with the operating system and which will not. In the column "Startup type" shows which of them start with Windows. If you do not need a particular service, right-click on its name and select the item in the context menu "Properties", then to the menu "Startup type" select item "Disabled" and click on "OK".

    6. Autorun control

    Team: msconfig

    Many user-installed programs add their executable files to the Windows startup list without asking. However, some of them are completely unnecessary and only slow down the computer boot and take away precious resources, working in the background. The service will help you get rid of such annoying programs System Configuration, launched by the command msconfig. To do this, go to the tab and uncheck the checkboxes for those applications that should not automatically start with the system.

    Important! Do not disable autorun of antivirus programs.

    7. Device Manager

    Team: devmgmt.msc

    This command opens device Manager, which gives a detailed overview of all the components of the PC and the devices connected to it. With its help, you can, for example, find out whether a driver is installed for a particular device and what its version is, and also update or reinstall the driver.

    8. Disk management

    Team: diskmgmt.msc

    Using this management console, you can control not only the hard drives installed inside your system unit, but also manage all external drives that you connect to your computer. In particular, using this settings window you can assign a different letter designation to the USB flash drive. To do this, right-click on, for example, USB-DISK (F:), select from the context menu “Change drive letter or drive path...”. In the window that opens, click on "Change" and using the drop down menu "F:" specify a new drive letter. Now all you have to do is click on "OK". Done, the letter has been changed.

    9. Picture improvement

    Team: dccw

    There are no perfect monitors. However, when processing photos or videos, getting the colors right becomes especially important. Using this feature, you can adjust the color rendering so that the printed photo differs as little as possible from what you saw on the screen.

    10. Fixing problems

    Team: psr

    This command first appeared in Windows 7. If you encounter the same system error over and over again while performing a certain sequence of actions, you can use this command to run By clicking on "Start Recording", you will start recording all your actions. The program will take screenshots of every element you clicked on. They can then be given to a computer setup specialist or sent to the program developers.

    11. Editing the registry

    Team: regedit

    Using the command regedit You can edit the system registry, which stores all Windows settings. This can be useful if you want to clear the registry of entries left in it by deleted programs. But be careful: only make changes if you know exactly what you are doing. Otherwise, problems may arise not only with already installed programs, but also with the performance of the system as a whole.

    Team: computerdefaults

    Does the wrong internet browser open when you click on a link in an email? Using this command, you can launch an application that will help you assign programs to perform common tasks in Windows.

    13. Reset settings

    Team: sfc /scannow

    Is it impossible to work with your computer due to error messages constantly popping up here and there? Resetting the main components to their original state can help here. To do this, dial "sfc /scannow".

    Attention! Then you may have to reinstall some Windows updates. Use for this Windows Update Service:Start - All Programs - Windows Update. Next click on Search for updates and follow the prompts to install updates.

    14. Quickly create multiple folders

    Team: md

    If you want to create multiple folders at once, launch the console and navigate to the directory where the folders should be created. To do this, type " CD", press [Space] and specify the path to the folder.

    Example: cd c:\2012 Click . Enter md and [Space]. Now type the names of the folders to be created, separated by a space test2 test2 test3, and then press . Ready.

    15. Folder synchronization

    Team: robocopy

    Another interesting feature that can be accessed from the console is called Robocopy. With its help you can synchronize the contents of two folders without resorting to third-party programs.

    For example, you want the contents of the folder "c:\1" match the contents of the folder "c:\2". Launch the console and type the command in its window robocopy. Now press [Space] and specify the path to the source directory c:\1. Click [Space] enter the path to the destination folder c:\2 and press [Space] again. The final touch - specify the command /copy:dat /mir and press . Ready.

    For dessert:

    Overview of the capabilities of the new operating system Windows 8:

    The Command Prompt is still present in all modern versions of Windows. It does not have a clear interface and is a window for entering commands. In the instructions we will consider several recommendations.

    The operating system has its own graphical interface designed for flexible user experience. Using it, we open windows in which we perform various actions with one click of the mouse (create, copy, delete), launch programs, utility utilities and much more. All actions can be done in cmd, but few people will, for example, copy a file.

    There are situations where you can’t do without the command line. For example, if you have a file on your computer with prepared commands, you copy them, and they will be executed quickly.

    Worth attention. This batch file contains a sequential list of commands that are executed line by line. Thus, you automate processes and save a lot of time.

    Calling the Windows 7 command line using traditional methods

    1. Hold down the Windows icon on your keyboard, then the R key, type “cmd” in it and click on ENTER or the OK button.

    It is also possible to launch “Run” through the Windows 7 task manager. Press CTRL + ALT + DEL at the same time. On the blue screen, select " ". In the window menu, click “file” -> “new task (run)”.

    2. Click “start” with the left button or the Windows icon on your keyboard. In the search field, type “cmd” and select cmd.exe.

    3. In “start” select “all programs” -> “standard” to open the Windows 7 command line, select it from the list as in the screenshot.

    4. If you need to call cmd for a specific folder, then hold down SHIFT (Shift key) and right-click on it. The “open command window” option will appear in the list. After clicking, the path to the folder will be written in the command line.

    Creating a shortcut to the command line

    The cmd console in Windows 7 is located at C:\Windows\System32\cmd.exe and you can also call it from this location. This method takes a long time, so we’ll make a quick launch shortcut on the desktop:

    1. Go to the path C:\Windows\System32\, and find cmd.exe. Right-click on it and select “create shortcut.” Copy it to your desktop and delete it from the System32 folder.
    2. Click on any empty space on the desktop with your mouse. In the menu, hover over "create" then select "shortcut". In the window as in the picture, specify the object location path C:\Windows\System32\cmd.exe. Click "next", type the name and click "done".

    Note: in my case, Windows 7 is installed on drive C, but the OS may be on another local drive. Be careful! You only need to change the first letter along the way.

    I advise you to appoint command line hotkey. Select the shortcut and press ALT+ENTER to open the properties window. In the “shortcut” tab, in the “short call” field, place the cursor, press any letter of the keyboard and OK. CTRL+ALT will be substituted automatically.

    You know, how to open the command line in Windows 7. Of all the methods, I would highlight using the cmd shortcut, creating it once, you will get the fastest access to the console.

    Of the common means, you can rank the following points according to the priority of simplicity: 1, 2, 4, 5. It’s up to you to choose which one to use.

    Often required, which has a full list of privileges.