What can be written on the command line. Creation of command line scripts. We work with files and folders.

💖 Like it? Share the link with your friends

Often, inexperienced users perceive the Windows command line as something completely unnecessary and obsolete. To think so is a big mistake. The value of the command line or otherwise CMD console cannot be overestimated even after it has lost most of its commands available in MSDOS.

The advantage of the command line is, first of all, in providing direct access to and its hidden opportunities, in addition, the CMD console has several useful built-in utilities designed to work with the software and hardware components of the computer.

Being a command line ace is completely optional, however, there are commands that every self-respecting Windows user should know. Here they are.

Assoc



Most user files in operating systems are associated with certain programs, which handles them by default. Such a connection is called an association. To view it, the assoc command exists. When it is executed, a list of extensions and file type associations is displayed. The assoc command also allows .

For example, the assoc .html = txtfile command for files with HTML extension the file type is set to txtfile (text). If you need to find out which program opens files with this extension, use the ftype txtfile command.

Cipher



This command is intended for encrypting and decrypting data on disks with file system NTFS, but it can just as well be used to clean up free disk space. It is very easy to use it. If you need to be sure to remove the remnants of all previously deleted files on drive D, run the cipher /w:D command in the console.

Driverquery



A useful command that allows you to view a list of all drivers installed in the operating system. When the command is executed without parameters, the data is output as a sorted list. The "Module" column contains the names of drivers without extension, the "Name" column includes short description driver, "Driver type" - respectively, the type, "Reference date" indicates the date of installation or the last modification of the driver.

FC (File Compare)



The FC command is useful mainly to coders, but it can also be used by those users who have to work with text files. This command allows you to compare the contents of two files, looking for inconsistencies between them. Let's say you have two files file1.docx and file2.docx and you want to compare them. Run the following command in the console:

fc /U "D:file1.docx" "D:file2.docx"

In this example, we compared two simple text documents. The command line interpreter found an inconsistency in one of the sentences and pointed to the specific location. The FC command also allows you to compare binary files, unicode files, determine the number of mismatches, and so on. If the files being compared are identical, an appropriate message will be displayed when the FC command is executed.

ipconfig



A useful command that allows you to determine the current TCP / IP protocol settings or simply an IP address. However, it only shows internal IP address, if you are using a router and want to know the IP with which you go to global network, it is better to turn to the help of special online services such as 2ip.ru.

netstat



This command lists all current internet connections. It is used mainly by administrators to display TCP and UDP connections, listening ports, routing tables, and statistics for various protocols. It can also be used to search for traces left by viruses and other malicious objects. The Netstat command without parameters displays the connection type, local address, external address, and current status.

Ping


Like Netstat, the ping command is used primarily by system administrators. It serves to diagnose computer networks. With its help, you can determine the availability of certain resources. Let's say you need to check the availability of Google. Because the DNS server Google has the address 8.8.8.8, in the CMD console you need to execute ping command 8.8.8.8.

The numeric IP address can also be replaced with a text URL - ping google.com. If the node is unavailable, the message “wait limit exceeded” will be displayed, and the number of losses will be 100 percent.

Tracert



Another "network" command designed for network diagnostics (tracing). The command allows you to get the chain of nodes through which the IP packet addressed to the final node passes. Used by system administrators to identify a problem that is preventing packets from being delivered to an end host. An example of using the command is tracing to the same Google site: tracert google.com.

Pathping



This command works in much the same way as tracert, but unlike the latter, it is more functional. The command performs tracing plus sending requests to intermediate nodes of the route to collect information about delays and packet losses on each of them.

power cfg



A powerful command line utility designed to manage Windows power settings. Executed only with parameters. Executed with the /Q switch, the Powercfg command displays the current configuration of the power scheme, with the /a switch it displays a report on the energy usage in laptops, with the –energy switch it generates a detailed text log about the status of computer components, including rechargeable batteries. Also the Powercfg command can be used to create backups power settings and deploy them on new hardware.

shutdown



This command is used to end a user session, shut down, restart, and hibernate the computer. Supports remote control. Shutdown is always performed with parameters. For example, a command like shutdown /s /t 0 will shut down open applications and immediate shutdown of the computer. You can view the list of available keys by executing shutdown /? in the console.

Sfc (System File Checker)



One of the most useful and necessary commands. Designed to detect and restore damaged or modified system Windows files. Recovery is performed from backups created by the operating system itself. To run a system scan followed by file recovery, run sfc command with the /scannow option. After the scan is complete, you will need to restart your computer. You need to run this command in a console running as an administrator.

tasklist



The Tasklist command does the same job as the Task Manager. Executed without parameters, it lists all running processes running on local or remote computer. At the same time, for each process, its name, identifier (PID), session name, session number and allocated volume are displayed random access memory. The Tasklist command supports the use of keys and filters. For example, Tasklist /SVC lists processes along with per-process services.

taskkill



If Tasklist simply displays a list of running processes, then Taskkill terminates their work in forced mode. True, for this you will need to know the ID of the process being terminated or the name of the executable file. Let's say you need to force close Notepad. First, we execute the Tasklist command and look at the PID of the notepad.exe process. In our case, it has a value of 2580. Knowing the PID of the process, you can easily “kill” it. The command itself will look like this: Taskkill /PID 2580. The Taskkill /IM notepad.exe command will work in much the same way, only in this example all instances of the notepad.exe process will be terminated.

Outcome

That's all for now. There are other useful CMD commands that users would like to be familiar with, but we will cover them next time. These include, in particular, Diskpart, a powerful disk and partition management tool that is not inferior to the capabilities of commercial software products such as Acronis Disk Director.

Does it make sense to learn the command line professionally? Unlikely, unless you are going to become a programmer or a system administrator.

However, those wishing to master the CMD console would also do well to pay attention to its advanced counterpart - the built-in PowerShell utility.

CMD is called differently - a command line interpreter (the exact translation of the abbreviation "command line interpreter"), a handler Windows commands, command processor. True, not all Windows users know what problems can be solved with it. As a rule, these are Linux users, system administrators and users who still remember the DOS operating system. Today we want to tell you how to launch and use CMD.

Launching the cmd.exe executable file (\Windows\System32 folder) that allows you to execute commands entered from the keyboard is possible in several ways.

Making settings

After launching cmd, you can start configuring it with context menu, which is opened by right-clicking on the window title. Then select the Default option and make the settings.

We configure the ability to use the mouse to select text:

  • go to the General tab;
  • turn on the checkbox Selection by mouse;
  • press the Ok button.

Now we can select a piece of text with the left mouse button and press the Enter key to copy it to the clipboard.

Use the Colors, Font and Position tabs to make the rest of the settings.

Note that all settings set using the Default option are saved for all subsequent cmd sessions. If you want to run a configuration task for the current session only, use the Properties option of the context menu.

Let's start working

We begin our acquaintance with the Windows command handler with a list of commands, which we obtain using the help directive. We pick it up in command line and make it run by pressing the Enter key:
help

The list consists of two columns - the name of the command and its description.


You can get detailed help in two ways:
help commandname
or
command_name /?

Example: get help for chkdsk :
help chkdsk
or
chkdsk /?

To avoid redialing, we use the command buffer, which is scrolled through using the key combinations Shift + or Shift + ↓ .

We use the right mouse button to paste the contents of the clipboard into the cmd handler screen.

The cls command is for clearing the screen:
cls

To exit cmd, use the exit directive:
exit

As you can see, everything is simple. Now let's figure out why cmd commands are needed, how to use them and what tasks they allow you to solve.

Working with files and folders

Although Windows Explorer specifically designed to work with files and folders, many users prefer it file managers such as, for example, Total Commander. Without a doubt, working with any of these programs is much more convenient than using the command line. However, it may happen that none of these applications can be launched, and in such emergency situations, cmd comes to the rescue with directives dir, cd, mkdir, rmdir, del, copy, type.

DIR

dir is used to view the contents of a folder (directory).

To view the contents of the current directory, simply type:

If you want to see only .exe executable files in the current folder, you will have to work a little and type a longer line:

Let's complicate the task and see the list of exe files of a folder that is not the current one, for example d:\work :

dir d:\work\*.exe

CD

cd is used to change the current folder.

We are in the d:\work\example\ folder and we want to go one level up to the work folder:

And now let's go to the folder d:\music\songs\ :

cd d:\music\songs\

And we will finish our voyage by going to the root folder of the current disk:

MKDIR and RMDIR

mkdir creates folders (directories), and can create a whole tree test->test1->test2 at once:

mkdir \test\test1\test2

And rmdir with the /S key will easily remove this tree:

DEL, COPY, TYPE

del and copy are for deleting and copying files, respectively.

Delete all files with the .tmp extension from the current folder:

We copy all files with the .mp3 extension from the music folder of the disk d: to a USB flash drive with the logical name f:

copy d:\music\*.mp3 f:

Our acquaintance with the commands of this group is completed by the type directive intended for displaying the contents of a text file on the screen:

type D:\"Krylov's Fables"\"Fox and Grapes.txt"


Note that file and folder names with spaces must be enclosed in quotation marks.

We work with the network

Network commands are a tool used mainly by system administrators and some advanced users to solve various network problems.

  1. ipconfig is used for tasks such as displaying TCP/IP protocol settings and configuring DHCP options.
    Get all settings network adapters:
    ipconfig /all
  2. nslookup is used to determine an ip address from a hostname and vice versa:
    nslookup odnoklassniki.ru
    tells us the ip-address of the Odnoklassniki social network - 217.20.147.94,
    nslookup 87.240.131.97
    "says" that the ip-address 87.240.131.97 belongs to another social network - VKontakte.
  3. ping allows you to perform the task of verifying connectivity with a host by sending/receiving icmp control packets. No response from the host does not always mean no connection. Sometimes hosts don't ping because sysadmins don't allow echo-reply icmp "response" packets to be sent.
  4. The tracert command, Linux users know it as traceroute , allows you to get a "route" - a chain of nodes that an ip-packet passes from the initial "our" node to the final one.
    Let's try to get "trace" on Google:
    tracert google.com


NET is the most popular network utility

net is one of the most used commands because it allows you to perform many tasks on network resources:

  • connecting/disconnecting network drives;
  • start/stop system services;
  • add/remove users;
  • management of shared "shared" resources;
  • setting the system time;
  • display information about resource usage.

We will demonstrate one of the features of the net.exe program - working with system services using the example of a print spooler.

To access services, we are used to using the windows interface, but knowing the name of the service, and the print manager is called Spooler, it is very easy to stop it

net stop spooler

and restart.

net start spooler

You can get a list of network services using this sentence:

net help services

But if you want to work with the print manager, source uninterruptible power supply, dispatcher through windows services, they can also be run from cmd using a snap file:

  • launch :
    taskmgr.exe
  • launching the registry editor:
    regedit.exe
  • launch device manager:
    devmgmt.msc

Some programs that have a command line interface are superior to standard ones. windows programs. For example, the devcon.exe program, called the command-line device manager, not only provides the ability to enable/disable/uninstall devices and update drivers, but also provides driver developers with information about devices that cannot be obtained using .

Related posts:

Command line or as it is also called cmd in the Windows 8 operating system is the same as in the younger versions of Windows7, Windows Vista, Windows XP, it follows that the same commands work the same in all versions.

So let's first figure out how to start the command line. To do this, you must have a working computer with an operating system.

Some commands if you are working through account as a normal user, there may not be enough rights to execute for security reasons, so always run the command prompt with administrator rights. There are 2 ways to run the command line:


In the window that appears, write cmd, click OK.


A command prompt window will open with a black background.


2) More fast way: through the Win + R hotkeys, here we also write cmd in the window that appears, press ok.

In windows 8, you can only use 2 ways, since there is no start menu. Let's write our first help command which will list all available commands with brief explanations.

List of all existing Windows command line commands:

ASSOC Printing to the screen or modifying file name extension mappings.
ATTRIB View and modify file properties.
BREAK Locks or unlocks extended CTRL+C handling on a DOS system.
BCDEDIT Sets properties in the boot database that allow you to control the bootstrap.
CACLS Displays data and modifies file access control lists (ACLs).
CALL Calls one batch file from another and can also pass input arguments.
CD
CHCP Output or set encoding.
CHDIR Displays the title or moves to another folder.
CHKDSK Diagnostics of the drive for errors.
CHKNTFS Shows or changes the drive diagnostics during boot.
CLSO cleaning the display of all characters.
cmd Starts a Windows command line program. You can run an infinite number of them on one computer. They will work independently of each other.
COLOR Changes and sets the main background of the window and the fonts themselves.
COMP Shows the differences and compares the contents of two files.
COMPACT Changes and shows file compression in NTFS.
CONVERT Changes FAT disk volumes to NTFS. The current drive cannot be changed.
COPY Creates a copy of a file or files and places them in the specified location.
DATE Shows or sets the current date.
DEL Destroys one or more files at once.
DIR Shows the names of files and folders with their creation date, located in the current folder or specified in the folder options.
DISKCOMP Compares and shows the differences between 2 floppy drives.
DISKCOPY Creates a copy of the contents of one floppy drive to another.
DISKPART Shows and changes the properties of a disk partition.
DOSKEY Modifies and re-invokes command lines; creates macros.
DRIVERQUERY Displays information about the "state of affairs" and attributes of the device driver.
ECHO Displays textual information and changes the display mode of commands on the screen.
ENDLOCAL Ends environment localization for a batch file.
ERASE Destroys a file or files.
EXIT Terminates a command line program
FC Shows differences between two files or two sets of files and compares them
FIND Searches for a text string in files or in a single file.
FINDSTR Advanced search for text strings in files.
FOR Cycle. Repeats the execution of the same command the specified number of times
FORMAT Formatting the drive for Windows.
FSUTIL Displays and sets file system attributes.
FTYPE Provides the ability to edit and view file types, which are primarily used in file name extension matching.
GOTO Transfers control to another specified command.
GPRESULT Displays information about group policy for a computer or user.
GRAFTABL Gives Windows feature show extended character set in graphics mode.
HELP Displays all data about existing Windows commands.
ICACLS Shows, modifies, archives or restores ACLs for files and folders.
IF Executes commands based on a given condition.
LABEL Creates, modifies, and destroys volume labels for drives.
MD Creates an empty directory.
MKDIR Creates an empty directory.
MKLINK Creates symbolic and hard links
MODE Configures system devices.
MORE Sequentially displays information in blocks of one screen size.
MOVE Moves files from one location to another.
OPENFILES Shows files that are open on the shared folder by the remote user.
PATH Displays or sets the full path to executable files.
PAUSE Terminates the execution of command line commands and prints informative text.
POPD Restores the previous active folder value that was saved with the PUSHD command.
PRINT Prints the contents of a text file.
PROMPT Modifies the command prompt Windows line.
PUSHD Saves the active folder value and navigates to another folder.
RD Destroys a directory.
RECOVER Resurrects readable data from a bad or damaged hard drive.
REM Places comments in batch files and the CONFIG.SYS file.
REN Changes the name of both files and folders.
RENAME Similar team REN.
REPLACE Swaps files.
RMDIR Destroys a directory.
ROBOCOPY Advanced tool for copying files and entire folders
SET Shows, sets, and destroys Windows environment variables.
SETLOCAL Localizes environment changes in a batch file.
SC Allows you to work with services
SCHTASKS Allows you to run any program and sequentially execute the necessary commands according to a given plan
SHIFT Changes the position (shift) of the inline parameters for the batch file.
SHUTDOWN Shuts down the computer.
SORT Sorts the input according to the given parameters.
START Launches a program or command in a new window.
SUBST Assigns a drive name to the specified path.
SYSTEMINFO Displays information about the operating system and configuration of the computer.
TASKLIST Shows a list of all running processes with their IDs.
TASKKILL“Kills” or stops the process.
TIME Sets and displays the system time.
TITLE Sets the name of the window for the current session of the CMD.EXE command line interpreter
TREE Displays the directories of the drive in a convenient visual form.
TYPE Displays the contents of text files.
VER Displays brief information O Windows versions.
VERIFY Checks for file write errors on the drive.
VOL Displays labels and serial number drive volumes.
XCOPY Creates a copy of files.
WMIC Displays WMI on the command line.

At a time when everyone uses the graphical interface, the usual command line (console) is still relevant. This is the ancestor of the human-computer interface. In this article I will tell you what it is and in what ways the Windows 7 command line is launched, and I will show the main console commands(video attached!)

The console is one of the types of text interface, which 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 given by entering them from the keyboard.

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

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

How to run command line

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

To start the command line, you need to go to the menu "Start -> Run" and in the window write the word "cmd" and press "Enter". In Windows 8 (or if there is no Run menu item), press the Win+R keyboard shortcut.

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

Sometimes it becomes necessary to open a command prompt as an administrator. This is necessary for executing 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 program "cmd" and select "Run as administrator"

If necessary, the console can be found at the standard address "C:\Windows\System32\cmd.exe" and called from there in normal mode, or through the right button with administrator rights. You can create a desktop shortcut for yourself by simply dragging it from the Start -> Accessories -> Command Prompt menu.

Since sometimes they want to run the command line every time with administrator rights, you can click on the shortcut, select "Properties" and on the "Shortcut" tab, click the "Advanced" button

Check the "Run as administrator" box here.

This is what the console looks like. As you can see, there is nothing superfluous, everything is done quite ascetically. In the window you can see the familiar "copyright" sign, indicating that the software belongs to Microsoft, below - the current directory and the cursor, which means ready to start working.

Appearance can be given some changes so that it is more suitable for a particular user. This can be done by right-clicking on the title bar of the window and selecting "Properties". There you can configure colors, font, layout and some other command line options in Windows 7

How to copy and paste text in the console

The developers screwed us over because the standard Ctrl+C/V and Ctrl/Shift+Insert buttons don't work here! To copy text:

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

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 the text with the mouse, without selecting the “Mark” item, and we will paste the text simply by pressing the right button.

If you uncheck "Quick Insert", then the text will be inserted over the existing one without shifting it to the right.

Buttons for working in the Windows 7 command line

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

Arrows "Up / Down" help you navigate through the history of entered commands;

- enter the last command by letter;

- the output of the previous command;

- displaying a numbered list of commands (usually the system remembers the last 50 commands, although you can configure it differently);

- moving the cursor to the beginning / end of the line;

— move back/forward one word;

- switching between insert and overwrite modes (as in Word);

- delete the entered text.

Basic command line commands

The console has a bunch of commands, and separate tutorials are devoted to this. I will show only some of the most popular of them. Almost any command can be run with parameters. To see help on a command, you need to enter it with a question mark, like this:

team /?

In the help to the command, optional parameters (that is, without them there will be no execution errors) are indicated in square brackets:

The command to read the contents of a folder - dir

Displays the contents of a directory. To select another directory (not the one displayed by default), you must specify the required path. Eg:

dir C:\Temp

The command to change the current directory is cd

Changes directory. The current "location" can be viewed here:

To change the current directory, you need to type the command: cd, space, directory name. For example:

cd c:\windows

To change to another drive, simply enter the drive name followed by a colon, such as "d:".

Note:

- it is not necessary to prescribe the disk if the required directory is already on open disk;

- so that when you enter the “cd” command you can go to another disk, you must specify the /D parameter (the so-called flag) in the command. The command will then look like this:

cd /D d:\temp

The command to create a directory is mkdir

Creates a new folder with the given name. In order for the folder to be created in the specified directory, you must register the appropriate command, for example:

The same command allows you to create an entire directory tree, in which case the command will look like this:

mkdir c:\1\2\3\4\5\6, where the numbers are replaced with their folder names

Delete folder command - rmdir

Enough useful command, with which you can remove an unnecessary directory. It looks, for example, like this:

rmdir c:\temp\test

It should be taken into account that in standard form The command will delete only empty directories. If the folder contains content of any kind, the user is presented with the message "The folder is not empty." To delete a folder along with its contents, add the /S option to the command. Then the command will look like this:

rmdir /s c:\temp\test

The deletion is confirmed by pressing the "Y" and Enter keys.

Popular utilities and programs for the console

In addition to built-in commands, the command line is often used to launch console (with a text interface) and regular programs. To do this, it is not necessary to open the console itself, but you can enter the command directly in the Run window. But at the same time, after its execution, the window will quickly close and disappear. That is, if you want to see the results of the utility execution, you need to run it in Windows 7 from the command line itself.

Shutting down the computer - shutdown

Turns off the computer. Here, most users ask a completely logical question: why go into the console to turn off the computer? The answer is simple. For example, a computer is working on a specific task that cannot be interrupted. And at this time you need to leave, or go to bed corny, while you don’t want to leave the computer on all night.

Of course, there are other ways, but almost all of these methods involve launching an external application. If they are not at hand, then the command line commands in Windows 7/8 will come in handy. So, to turn off the computer, we type:

shutdown -s

This command will immediately turn off the computer. If it is necessary to postpone the process, we type:

shutdown -s -t 1200, where the numbers are the time after which the computer will turn off (in seconds)

After pressing the Enter key, the countdown will begin until the PC is turned off. In this case, in Windows 7, the following message will appear:


10 minutes before the end, a system notification will appear. If there is no longer a need to turn off the computer, then you can stop the countdown simply by adding the -a parameter to the command:

shutdown -a

This will disable the countdown.

System information - systeminfo

As the name implies, the command will show the user some information about the user's system and hardware:

System File Checker - sfc

Launches a utility that repairs corrupted system files. Very useful utility, which can also be supplemented with some commands:

/scannow - for immediate scanning of protected system files;

/scanonce - to scan protected system files once at the next system startup;

/scanboot - to scan protected system files every time the system starts.

If the scan reveals damaged or "left" files, the program will ask you to insert a disk with the Windows installation distribution.

appwiz.cpl- opens the standard Add/Remove Programs window

calc- built-in Windows "Calculator"

notepad- notebook

pbrushgraphics editor Paint

services.msc– management of system services

In conclusion

Here is a minimal set of commands that can be used when working with the console. There are many more useful, or even just interesting commands, many of which the user can learn on their own. To do this, simply enter the command " help' and it will show the available commands.

And in order to find out detailed information about any of them, you just need to enter the HELP query and indicate the name of the command after the space. After that, the console will display all the necessary information, including the syntax and other components of the command.

That's all, here's a short video on how to run the command line in Windows 7 and how to run commands

Until the moment when operating systems learned to “communicate” with users using the usual graphic images, the input and output of information into the computer was carried out exclusively with the help of 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 professional programmers, system administrators and other employees of the IT industry. For ordinary users manufacturers operating systems created a convenient GUI, which 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, and so on) still supports input and output of information through text commands. The Windows command line is a clear example of this. Let's figure out what it is.

What is command line

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

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

Command line operating 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 the help of a GUI. The need to understand and know all these commands makes it difficult for ordinary users to use the command line to control the operating system. However, it is not so difficult as it seems at first glance.

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

In what situations can the command line be useful?

There are a number of reasons for using the command line. There are also situations in which it is simply impossible to do without its use. And in some cases, the fulfillment of certain Windows features, 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 this is not about that now.

One more situation. Let's say Windows XP (or any other version) is just stopped working, and important data remained on the hard disk, which urgently need to copy to a flash drive. If you have at least installation disk with Windows, then at a certain point in the installation of the operating system (without waiting for the installation to complete), you can call 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 drive.

The command line is also capable of quickly calling various standard master tuners operating system (such as Network Configuration Wizard) or system tools such as Registry Editor, Component Services, and others. It can also be used to produce direct various parameter settings Windows, exercise file management, run programs and do many other things.

How to use the command line

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

How to call the command line

Starting from Windows XP and up latest version this family of operating systems, the command line is invoked through the dialog " Run» (« Run”), in which you need to enter the command - “ cmd". This dialog is launched by pressing the Win keys simultaneously. + R:


In Windows XP (unlike later versions) in the menu " Start" there is a special label, which is called " Execute...". If you click on it, the dialog will also start.


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

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

IN . As well as in the 10-ke, about the features of which you can learn more.

Working on the command line

To " cmd"executed this or that command, it is enough to 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 can see, there are many of them. However, these are not all 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 extensible shell, which indicates the possibility of adding more and more commands to the list of actions performed by it.

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

Let's try to move from one local drive to another, view 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 start.

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 went to this folder through Conductor). And "C:\" is local disk where you are. 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 whatever). To view disk contents(or in general any folders) use the command " dir". Enter it right here and you will see a list of files and folders available on the "D:\" drive.


Now create a folder right at the root of the disk. To do this, use the command - " mkdir”, and as a parameter, separated by a space, you need to enter the name of the future folder, for example, “ mkdirxp". In this case, a folder named " xp».


After creating it, you can enter through the explorer to your disk 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 navigate to is also used as an argument. Let's introduce " cd xp” and get inside the folder ( make this folder current).


Let's create another folder 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, just enter the "/?" immediately after the command, and a prompt will be displayed on the screen. For example, enter " dir/?". Another option to launch a prompt: " help directory».


Remembering all existing commands is not easy - there are a lot of them. The official Microsoft website has the most complete guide on the command line, although the descriptions issued by the command help quite enough.

Related videos



tell friends