Questions on the command line. Windows command line commands: list. Why is the command line needed at all?

CMD is called differently - the command line interpreter (the exact translation of the abbreviation "command line interpreter"), the Windows command handler, the command processor. True, not all Windows users know what tasks can be solved with its help. 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 using the 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 type it in the 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

Despite the fact that Windows Explorer is specifically designed to work with files and folders, many users prefer 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.
    We get all the settings for 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, Uninterruptible Power Supply, Remote Access Connection Manager through windows services, they can also be launched from cmd using the snap file:

  • start task manager:
    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 windows programs. For example, the devcon.exe program, called 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 windows device manager.

Save yourself so you don't lose!

How to control a computer without a mouse? To do this, you can launch the Windows cmd command line using the win r key combination, and then type cmd in the console that appears and press Enter.

A command line window has opened. Through it, you can turn off your computer, create/delete folders, set a program startup schedule, make programs system, change file extensions, start and stop applications, and much more.

Thus, if you want a number of cmd commands to be executed automatically on the computer, you can write them down in notepad and save them with the extension. bat.

An example of a simple program:
@Echo off.
Color 0a.
Chcp 1251.
echo.
Restarting the computer.
pause.
Shutdown /r.

This program restarts the computer and requires you to press any key to do this. To stop the execution of the program, you just need to close the window that appears.

Similar bat files (batch files) are often used to write computer viruses, which, by the way, are not noticed by antivirus programs (in most cases. And for secrecy, they are transferred to the .exe format.

You can read more about cmd commands below (or you can just write Help on the command line.

A.
Append - Allows programs to open files in specified directories as if they were in the current directory.

arp - display and change tables for converting IP addresses into physical ones used by the address resolution protocol.

Assoc - display or change associations for file name extensions.

at - the command is designed to run programs at a specified time.

atmsdm - monitor connections and addresses registered by the ATM call manager on networks with asynchronous transfer mode (ATM.

Attrib - change the attributes of files and folders.

Auditusr - sets the user audit policy.

b.
Break - turn on the Ctrl C key processing mode.

Bootcfg - This command line program can be used to configure, extract, modify or remove command line options in the Boot file. ini.

C.
Cacls - view changes to ACL access control tables for files.

Call - calling one batch file from another.

cd - display the name or change the current folder.

Chcp - display or change the active code page.

Chdir - display or change the current folder.

Chkdsk - disk check and report output.

Chkntfs - Displays or modifies disk check options at boot time.

Ciddaemon is a file indexing service.

Cipher is a file encryption program.

cls - clear the interpreter screen.

cmd - launches a new command prompt window.

Cmstp - install connection manager profiles.

Color - sets the color for text and background in text boxes.

Comp - compare the contents of two files or sets of files.

Compact - View and change file compression settings on Ntfs partitions.

Convert - converting the file system of a FAT volume to Ntfs.

Copy - copy one or more files.

D.
Date - display or set the current date.

Debug is a tool for debugging and editing programs.

Defrag - disk defragmentation.

del - delete one or more files.

Devcon is an alternative to Device Manager.

Diantz is the same as Makecab.

dir - list files and subfolders from the specified directory.

Diskcomp - compare the contents of two floppy disks.

Diskcopy - copying the contents of one floppy disk to another.

Diskpart - using the Diskpart script.

Diskperf is a disk performance counter.

Doskey - editing and recalling Windows commands; creating Dokey macros.

Driverquery - View a list of installed device drivers and their properties.

E.
Echo - display messages and switch the mode of displaying commands on the screen.

Edit - start the MS - DOS editor.

Endlocal - end localization of environment changes in a batch file.

Edlin - launches a line-by-line text editor.

Erase - delete one or more files.

Esentutl is a maintenance utility for Microsoft(R) Windows databases.

Eventcreate - This command allows the administrator to create a special event entry in the specified event log.

Eventtriggers - This command allows the administrator to display and configure event triggers on the local or remote system.

Exe2bin - Convert EXE files to binary format.

Exit - end command line.

Expand - uncompress compressed files.

F.
fc - Compare two files or two sets of files and print the differences between them.

Find - search for a text string in one or more files.

Findstr - search for strings in files.

Finger - display information about users of the specified system.

Fltmc - work with driver load filter.

for - executes the specified command for each set file.

Forcedos is a mapping of MS - DOS applications that are not recognized by Microsoft Windows XP.

Format - disk formatting for working with Windows.

Fontview is a font viewer.

Fsutil - manage reparse points, manage sparse files, unmount a volume, or expand a volume.

ftp is a file transfer program.

Ftype - View and change file types associated with a file name extension.

G.
Getmac - Displays the MAC address of one or more network adapters on a computer.

Goto - Transfer control to the line containing the label in a batch file.

Gpresult - Displays the resulting policy (Rsop) for the specified user and computer.

Gpupdate - Perform group policy update.

Graftabl - selection of a code page for displaying symbols of national alphabets in graphics mode.

H.
Help - displays an incomplete list of commands that are used in cmd.

Hostname - displays the name of the computer.

I.
if is an operator to conditionally execute commands in a batch file.

ipconfig - Display subnet mask, default gateway and information about your IP.

Ipxroute is the Nwlink IPX routing manager.

L.
Label - create, modify and delete volume labels for a disk.

Lodctr - update counter names and explanatory text for extended counter.

Logman - Schedule management for performance counters and event tracing log.

Logoff - end Windows session.

lpq - display the queue status of the remote print queue lpq.

lpr - Sends a print job to a network printer.

Lsass is a local security definition server.

M.
Makecab - archiving files in cab - archive.

md - create a folder.

mem - displays information about used and free memory.

Mkdir - create a folder with extended functionality.

mmc - open an MMC console window.

Mode - debug system devices.

Mofcomp - 32-bit Microsoft (R) MOF compiler.

More - sequential output of data in parts of one screen.

Mountvol - View, create and remove volume mount points.

Move - move and rename files and directories.

Mqbkup is a utility for archiving and restoring a message queue.

Mqsvc - provides the infrastructure for running distributed applications.

msg - send messages to the user.

Msiexec - Runs the Windows Installer.

N.
Nbtstat - Displays protocol statistics and current TCP/IP connections using NBT (Netbios over TCP/IP.

net - a package of applications designed to work with the network.

Net1 is the same as net.

Netsh - local or remote display and change of network settings.

Netstat - display protocol statistics and current TCP/IP network connections.

Nslookup - information output intended for DNS diagnostics.

Ntbackup - launch the archiving wizard.

Ntsd is a command line debugger.

Oh
Odbcconf - Odbc driver configuration.

Openfiles - This command allows the user to list the open files and folders that have been opened on the system.

P.
Pagefileconfig - configuration of paging files and virtual memory.

Path - display or set the search path for executable files.

Pathping - displaying information about hidden networks and data loss.

Pause - pauses the execution of the cmd script.

Pentnt - Detects Pentium processor floating point division errors, disables hardware floating point processing, and enables floating point emulation.

Perfmon - opens the "Performance" window.

Ping - Tests the connection to another computer.

Ping6 - ping command.

Popd - Changes one folder to the one saved by the Pushd command.

Powercfg - This command allows you to manage the power supply of the system.

Print - print a text file.

Prncnfg - configuring printer settings.

Prompt - Change command line prompt cmd. exe.

Proxycfg - Proxy connection configuration tool.

Pushd - Save current directory values ​​for use by the Popd command.

Q.
Qappsrv - Displays available terminal servers on the network.

Qprocess - displays information about processes.

Qwinsta - display information about terminal sessions.

R.
Rasdial is a command line communication interface for the remote access service client.

rcp - exchange files with the computer running the RCP service.

Recover - recovery of saved data on a damaged disk.

reg - editing the system registry through the command line.

Regsvr32 - registration server.

Relog - creates a new performance log from an existing one.

rem - put a comment in a batch file.

ren - rename files and folders.

Rename - rename files and folders.

Replace - replacement of files.

Reset - terminal services reset utility.

Rexec - execution of commands on remote hosts running the Rexec service.

rd - delete folder.

Rmdir - delete a folder.

Route - processing of network route tables.

rsh - execute commands on remote hosts running the RSH service.

rsm - Manage media resources using the Removable Storage service.

Runas - use applications on behalf of another user.

Rundll32 - run standard commands - functions embedded in dll.

Rwinsta - reset the values ​​of subsystems of equipment and programs of the session to the initial state.

S.
sc - Establish communication with the NT Service Controller and its services.

Schtasks - Create, delete, modify and poll scheduled tasks on the local or remote system.

sdbinst is a compatibility database installer.

Secedit - automate security configuration tasks.

set - output, assignment and deletion of variables on the command line.

Setlocal - start localizing environment changes in a batch file.

Setver - sets the version number that MS - DOS reports to the program.

sfc - Windows File Checker.

Shadow - Allows you to monitor another Terminal Services session.

Shift - change the contents of the inline parameters for the batch file.

Shutdown - end the session, shutdown and restart the Windows system.

Smbinst is a process owned by System Management Bios Driver Installer.

Sort - sorting files.
Start - launch a program or command in a separate window.

Subst - Map the drive name to the specified path.

Systeminfo - displays information about system settings.

T.
Taskkill - End one or more processes.

Tasklist - shows running programs and processes currently running.

Tcmsetup - telephony client installation.

Tftp - exchange files with a remote computer running the Tftp service.

Time - view or change the current time.

Title - assignment of the title of the interpreter window.

Tlntadmn - remote computer control.

Tracert - trace the route to the specified node.

Tracerpt - Handles event tracking log binaries or data streams.

Tracert6 - version of Tracert for the Ipv6 protocol.

Tree - displays the structure of a disk or directory as a tree.

tscon - Attaches a user session to a terminal session.

tsdiscon - Disconnect a terminal session.

tskill - Terminate a process.

tsshutdn - Shutdown the server in due course.

Type - displaying the contents of text files on the screen. Typeperf - Prints performance information to the screen or log. U Unlodctr - remove counter names and explanatory text for extended counter. Userinit is a Windows system explorer. V ver - displays information about the version of Windows. Verify - setting the mode for checking the correctness of writing files to disk. vol - display the label and serial number of the volume for the disk. Vssadmin is a volume shadow copy command line tool. W W32tm - time service diagnostics. Wbemtest is a Windows management instrumentation tester. Winver - displays information about the version of Windows. Wmic is a scripting tool. X Xcopy - copy files and folder tree.

In order to start working with the command line on Windows, you must first find it. In Windows 7 and Windows 10, this can be done in several popular ways.

Method 1. Press the key combination on the keyboard "Win" "R"

and in the Run window we write the command cmd

After that, the Windows command prompt will be launched.

Method 2. At the start, write the command CMD or "command line" and select the program icon.

If you need to run as administrator, right-click on the cmd file and select "Run as administrator".

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

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

command line command. List of all existing Windows command line commands:

ASSOC Print to screen or modify file name extension mappings.
ATTRIB View and modify file properties.
BREAK Disables or disables extended CTRL+C processing on a DOS system.
BCDEDIT Sets properties in the boot database that allow you to control booting.
CACLS Displays data and modifies file access control lists (ACLs).
CALL Calls one batch file from another and can also pass input arguments.
CD Displays the title or moves to another folder.
CHCP Output or set encoding.
CHDIR Displays the name or moves to another folder.
CHKDSK Diagnose the drive for errors.
CHKNTFS Displays or modifies the drive's diagnostics at boot time.
CLSO clears 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 differences and compares the contents of two files.
COMPACT Changes and displays file compression in NTFS.
CONVERT Converts 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 the command line program.
FC Shows the 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 Format the drive for Windows.
FSUTIL Displays and sets file system attributes.
FTYPE Gives you the ability to change and view file types, which are primarily used for file name extension matching.
GOTO Transfers control to another specified command.
GPRESULT Displays group policy information for a computer or user.
GRAFTABL Enables Windows to display the extended character set in graphics mode.
HELP Displays all information about existing Windows commands.
ICACLS Displays, 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 Sets system devices.
MORE Sequentially displays information in blocks of one screen.
MOVE Moves files from one location to another.
OPENFILES Shows the files that are open on the shared folder by the remote user.
PATH Displays or sets the full path to executable files.
PAUSE Stops 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 prompt on the Windows command line.
PUSHD Saves the value of the active folder and moves to another folder.
RD Destroys a directory.
RECOVER Recovers 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 to the REN command.
REPLACE Repositions files.
RMDIR Destroys a directory.
ROBOCOPY Advanced tool for copying files and entire folders
SET Displays, sets, and clears Windows environment variables.
SETLOCAL Localizes environment changes in a batch file.
SC Allows you to work with services
SCHTASKS Allows you to run any programs 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 Starts a program or command in a new window.
SUBST Assign the 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 title of the window for the current session of the CMD.EXE command line interpreter
TREE Displays drive directories in a convenient visual form.
TYPE Displays the contents of text files.
VER Displays summary information about the version of Windows.
VERIFY Checks for file write errors on the drive.
VOL Displays the labels and serial number of the drive's volume.
XCOPY Creates a copy of files.
WMIC Displays WMI on the command line.

Video Windows Command Prompt (CMD).Part 1

Let's look at all the options:

  1. Run cmd as administrator with the Win + X keyboard shortcut;
  2. Calling the command line through the Windows 10 search;
  3. Opening a windows 10 command prompt shortcut with administrator rights;
  4. Command line execution through Windows Tools;
  5. Calling the Windows 10 command line through the "Task Manager";
  6. Opening cmd from explorer.

Run cmd as administrator with Win+X keyboard shortcut

Press the key combination Win + X, select "Command Prompt (Administrator)".

Calling the command line through Windows 10 search

To call the command line, hover the mouse over the search button, enter "CMD", press the right mouse button - "Run as administrator".

Opening windows 10 command prompt shortcut with admin rights

We create a shortcut on the desktop, according to the methods described in the article about the usual launch of the command line in Windows 10. Next, press the right mouse button and select "Run as administrator".

Command Line Execution via Utilities-Windows

To execute the command line, open the Start menu - Windows Tools - Command Prompt, then right-click "Advanced" - "Run as administrator".

Calling the Windows 10 command line through the "Task Manager"

To call the command line in the "Task Manager", open the "File" tab, the item "Run a new task", in the window that opens, enter "CMD", check the box "Create a task with administrator rights" and click the "Ok" button.

Opening cmd from windows explorer

The advantage of this method is that the path in the opened "cmd" window will correspond to the path to the folder. Opening the command line from the explorer menu: "File" - "Open command line" - "Open command line as Administrator".

The command line, or console, is a special tool for deep tuning the Windows 8 operating system. This utility is designed to work with MsDos commands. The lack of a graphical interface often frightens users, but with the help of this program, you can quickly perform any operation on the system. Some actions (for example, ping checking or tracing) cannot be done in any other way at all. This article details how to call the console, and also describes the basics of working with it.

Run Dialog Box

The easiest and fastest way to open a command prompt is with the Run dialog. This is another text-based utility that is designed to quickly launch programs in Windows by entering their names. There is nothing complicated in working with the dialogue, just follow the instructions presented:

  1. Simultaneously press the "Win" and "R" buttons on your keyboard. With this key combination, you can quickly call up the "Run" dialog.
  2. In the text field of the window that opens, you must enter the command "cmd" without quotes.
  3. Press Enter or the OK button to confirm the command and open the console.

If you are using version 8.1 operating system, at the bottom of the screen you will have a start menu button, as in the "seventh" part. This menu contains a search bar, the functions of which are similar to the above dialog. Use it if hotkeys seem inconvenient to you.

Open as administrator

Some actions that may affect the operation of the operating system can only be performed with Windows administrator rights. To do this, you need to open the console in another way:

Basics of work

All actions in the console are carried out using text commands. To find out their list and get help, type "Help" and press Enter. The utility will show you a list of the various options that are available to the user. If you want more information about any of them, type " help commandname ".

cmd windows command line. The need to use the command line

The cmd line, which is a standard tool of the Windows platform, is no different in different versions of operating systems - in the seventh, and in the eighth, and in the tenth, and even in XP. And all teams work the same in each of them.

The advantage of using a line is to speed up the work - sometimes typing the desired command is much faster than searching the system folders for the corresponding file. Moreover, to speed up work with CMD, a link to it can be displayed on the desktop - or even on the quick launch bar.

The disadvantages of the interface can be called:

  • manual command input from the keyboard;
  • the need to run CMD as an administrator (otherwise, most commands do not run);
  • quite a large list of commands that are difficult to remember.

Externally, the command line in many ways resembles the interface of the DOS system. And, although it allows you to solve many more tasks, some commands overlap with the legacy platform. For example, "format", "cd" and "dir", which are necessary for working with folders and disks.

The command line is a special program that allows you to control the operating system using text commandsentered in the application window. Its interface is completely text-based, unlike the usual look of the operating system.

Performing actions using text expressions, of course, is not as convenient as clicking 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 network and equipment settings, calling system applications. Here are some examples of its use:

  1. The systeminfo command collects information about the system, including installed updates and network information. The graphical interface does not provide such data.
  2. chkdsk - check the disk for errors with the creation of a report.
  3. sfc /scannow is a useful command to run a scan and repair corrupted files.
  4. ipconfig - allows you to find out the IP address of your computer in a split second.
  5. ping - check 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 of useful uses for this application. In addition, through the program window, you can quite successfully work on a computer without resorting to the mouse.

Ways to turn on

There are several options to open the Windows Command Prompt:

In a version higher than Windows 8, in order to apply this method, you need to click on the magnifying glass next to the username.


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

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

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

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

Opening with elevated 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 manage the system. This is done to improve reliability and reduce the risk of damage from malware.

Running as administrator is a different concept than the administrator account. It involves raising the level of rights, obtaining the highest access to the program to change the system. Thus, more functions will become available in the application (in our case, on the command line). When opened normally, they are simply blocked. For example, if you want to disable User Account Control via cmd.exe, it will not be available in normal mode, only as an administrator.

Thus, the command line is a kind of universal Windows system management tool that allows you to perform various tasks without switching between many windows, menus, programs. All commands are sent through a text box, you can quickly change network settings, security settings, check or format drives, and perform many other functions in seconds.

In this article, I will tell you about the Windows command line, what it is for in a modern operating system. I will talk about the basic commands of the Windows command line, and also touch on the topic of BAT scripts, they are also CMD.

Despite the fact that the yard is far from the 80s or 90s, many operating systems, including Windows, have a command line or terminal. What is it for? After all, there is a convenient graphical interface with which you can easily and simply do everything.

On the one hand, this is true, but on the other hand, there are many more utilities that work from the command line, for example, adb or fastboot Android, and you can also create special scripts that will significantly, very significantly, speed up and simplify your work in Windows.

How to run command prompt on windows

In order to start working with the command line on Windows, you must first find it. In Windows 7 and Windows 10, this can be done in several popular ways.

Method 1. Press the key combination on the keyboard "Win" "R"

and in the Run window write the command cmd

After that, the Windows command prompt will be launched.

Method 2. At start write the command cmd or "command line" and select the program icon.

If you need to run as administrator, right-click on the cmd file and select "Run as administrator".

How to work with the Windows command line?

To display the entire list of commands in cmd, write the command "HELP" to display the entire list of commands.

I doubt that this will help you a lot at the very beginning of mastering the command line, so it's better to sort something out with an example.

Let's create an empty file in some folder. To do this, you will need to do the following:

  1. Understand where you are after running the command line
  2. Go to required folder
  3. Create file

After starting CMD, you will automatically find yourself in the C:\WINDOWS\system32> folder

To control the location where you are, you will be helped by the information on the left, up to the flickering cursor, showing the location of the folder. To navigate between folders there is cd team.

To go to the root of the C:\ drive, you need to type the command:

cd C:\

If you are near the folder you need, you can write its name.

For example, I'm already at the root of the C:\ drive and I need to go to the adb_run folder, then I write the command:

cd adb_run

To find out what folders are nearby, the command will help me dir.

If I need to go from the C:\adb_run\ folder to the C:\WINDOWS\system32> folder, I will have to write the entire full path:

Cd C:\WINDOWS\system32

To write the path faster, it is better to use the TAB button, which fills in the name of the folders before.

That is, in order for me to go to the C: \ WINDOWS \ system32 folder, I wrote the command like this:

Cd C:\Win TAB button system3 TAB button

And I didn't have to type many letters, autocomplete worked.

In order for me to exit the system32 folder (C:\WINDOWS\system32) to the Windows folder, I need to type the command cd..

As you can see, the team cd..- this is an analogue of the "back" button, more precisely, go to the folder above.

For especially lazy people, you can type the command cd, space, and in the window title, copy the address of the folder and paste it into the command line and press "Enter".

I hope you figured it out, now I will create a folder in the root of the C:\ drive using the command mkdir. If I have just started the command line, then it will look like this:

Cd C:\ mkdir Hello

That is, I first went to the C drive, and then created the Hello folder. It could have been done like this:

Mkdir C:\Hello

I did not go where I need to, but immediately indicated the path where I need to create a folder.

We check if the folder was created using the dir command, and yes, I did it!

Suppose in the folder that we created Hello there is a console utility adb.exe. How to run it?

Very simple!

Go to Hello folder

Cd C:\Hello

make sure adb.exe is in this folder

and run adb

If I suddenly want to delete the adb.exe file, I will have to type the del command:

del adb.exe

If I am in Hello folder.

Del C:\Hello\adb.exe

If in any other folder.

I just told you about basic work with the Windows command line. You may have thought this was a very long and boring task, but in the near future I will teach you how to write scripts, the so-called "batch files" that interact with cmd and significantly speed up your computer work or automate some actions!

Do you still have additional questions? Ask them in the comments, tell us what you did or vice versa!

The most common startup suggestions are: Start, Run, cmd . The Start menu has a Run option. It runs a program that allows you to send single commands to the Windows system. In this case, the cmd command launches the cmd.exe executable located in the system32 folder.

C:\WINDOWS\system32\cmd.exe

On some versions of Windows, the Run menu item is removed by default. In this case, press + R, type cmd, then Enter. You can also launch the command line directly from the system32 folder by making a shortcut to launch it on the desktop (right-click on cmd.exe and select Send / Desktop from the menu) or through the task manager (new task button - cmd).

By default, the command line cannot be used with the mouse (move the cursor or select text). This is inconvenient in general and for beginners in particular. In addition, the black screen looks somehow too gloomy and dull. So after running the command line

you will need to change its settings. Right-click on the cmd window and select defaults. It should be noted right away that the default settings apply to cmd.exe as a whole, and the properties - to a specific open window.

In the command line properties window that appears, we see four tabs:

On the Options tab, it is worth checking the items discard repetitions (to reduce the filling of the command buffer) and mouse selection (so that you can use the mouse in your work).

On the Fonts and Colors tabs, everything is simple: choose the size, type and color of the font, as well as the background color of the window. I will only note that the font size affects the size of the command line window, so it must be set before the size of the window, and not after.

The Location tab specifies the size of the window and its initial location at startup. I still didn’t fully understand in what units the values ​​\u200b\u200bare presented, so I advise you to set the size, guided by the preview window on the left.

It is worth noting that the size of the buffer affects the capacity of the window, i.e. on the amount of information that can be viewed without problems after displaying the results of the command execution (horizontal and vertical scroll bars). If you set equal sizes for the window and the buffer, then the window will display only the tail of the output information, which will fit there.

Also, if the line does not fit into the width of the window, it will wrap it. It is less convenient to perceive the information presented in this way. Therefore, I always set the buffer much larger than the window size. This allows you to view large amounts of information using the scroll bars on the right and bottom. The image below is clickable. The preview shows the beginning of the output of the dir command for the system32 folder, and by clicking on the preview you can see the tail of the output (pay attention to the scroll bar on the right - there is a lot of data).

Command Line Commands

The console is configured, now it remains to acquaint you with the command line commands. To display their complete list, just type the help command.

help - display help for commands help CD or CD /? - display help on one command (for the CD command) cd - change to the root directory cd .. - change to the parent directory D: - go to disk D . dir - display the entire contents of the folder dir *.exe - list the exe files of the folder cls - clear the command line screen

The command line remembers the commands you enter. You can scroll through them using the ⇑ and ⇓ keys. You can view the contents of the folder using the Tab key (Shift + Tab scrolls in reverse order). You can scroll through the files for a specific letter or letters. For example, typing the letter s and by pressing Tab , you can scroll through only files and folders starting with this letter ( s system, s system32, s ystem.ini etc.) . How it can be used:

For example, you need to go from the root of the C drive to the system32 folder, find and launch the control panel in it. You can just type:

C:\ windows\system32\control.exe

But this is not always fast and convenient, and besides, you don’t always know what exactly you need to type. Therefore, you can type the command cd, then after the space type wi Windows, put a slash after it, type letters sy, scroll with the Tab key to the folder sy stem32, then again a slash and the same with control.exe.

C:cd wi ndows\ sy stem32\ co ntrol.exe

This method with tabs is much faster in most cases than simple typing, since file and folder names can be long.

When mouse support is enabled, you can copy information from the command line by selecting a section of text with the mouse and pressing Enter. The right mouse button, on the contrary, pastes information from the clipboard into the command line.

In conclusion of the article, I will say that cmd.exe is just an input-output program, the same as notepad. Of course, there are more advanced analogues that can also be used. One such program is Console Portable.

By the way, in the GNU Linux operating system, the command line can be called directly from the folder. In this case, the line will open immediately with the address of the folder and it will not be necessary to type it manually. In Windows, in order to open a command prompt directly in a folder, you need to hold down Shift , press the right mouse button and select "Open command window" from the menu.

You can also add this feature (and a number of others) using the FileMenu Tools context menu extension program:

Share with friends or save for yourself:

Loading...