Execute commands on the command line. Working with the Windows Command Line (CMD)


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

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

Command Line Concept

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

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

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

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

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

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

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

Quick reference to shell commands (Cmd.exe)

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

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

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

Sequence of events when executing a command

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

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

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

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

Creating Command Line Scripts

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

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

Hostname ver ipconfig -all

Controlling the display of text and commands

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

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

Echo The system host name Is: hostname

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

Echo off echo The system host name is: hostname

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

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

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

Studying system information

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

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

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

Where /r base_directory_file_name

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

Where /r C:\data*.txt

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

Where /r C:\data*.*

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

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

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

Commands for using the registry

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

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

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

System Services Management

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

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

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

Sc ServerName Subcommand

Reboot and shutdown systems from the command line

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

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

Shutting down the local system:

Shutdown /s /t Shutdown Delay /1 /f

Shutdown /r /t Shutdown Delay /1 /f

Application, process and performance management

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

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

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

Save it for yourself so you don’t lose it!

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.

The command prompt window opened. Through it, you can turn off the computer, create/delete folders, set program launch schedules, make programs system programs, change file extensions, start and stop applications, and much more.

Thus, if you want a number of cmd commands to be executed automatically on your 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.
Reboot your 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 simply need to close the window that appears.

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

You can read more about the 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 - displays and changes IP-to-physical address conversion tables used by the address resolution protocol.

Assoc - display or change associations based on file name extensions.

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

Atmsdm - monitors connections and addresses registered by the ATM call manager on asynchronous transfer mode (ATM) networks.

Attrib - change the attributes of files and folders.

Auditusr - sets the user audit policy.

B.
Break - enable processing mode Ctrl keys C.

Bootcfg - This command line program can be used to configure, retrieve, change 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 - output or change the active code page.

Chdir - output or change the current folder.

Chkdsk - disk check and report output.

Chkntfs - Displays or changes disk check parameters during boot.

Ciddaemon is a file indexing service.

Cipher is a file encryption program.

cls - clear interpreter screen.

cmd - launches a new command line window.

Cmstp - installing connection manager profiles.

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

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

Compact - view and change file compression settings in Ntfs partitions.

Convert - converts the FAT volume file system 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 a device manager alternative.

Diantz is the same as Makecab.

dir - displays a list of files and subfolders from the specified directory.

Diskcomp - compares the contents of two floppy disks.

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

Diskpart - use the Diskpart script.

Diskperf - disk performance counter.

Doskey - editing and re-calling Windows commands; creating Doskey 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 - launch the MS - DOS editor.

Endlocal - complete localization of environment changes in the batch file.

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

Erase - deleting one or more files.

Esentutl - maintenance of utilities 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 a local or remote system.

Exe2bin - converts EXE files into binary format.

Exit - end the command line.

Expand - unpacks compressed files.

F.
fc - compares two files or two sets of files and prints the differences between them.

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

Findstr - search for strings in files.

Finger - displays information about users of the specified system.

Fltmc - work with driver load filter.

for - execute the specified command for each file in the set.

Forcedos - comparison of MS - DOS applications that are not recognized Microsoft system Windows XP.

Format - formatting the disk for working with Windows.

Fontview is a font viewer.

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

ftp is a file transfer program.

Ftype - View and change file types associated with filename extensions.

G.
Getmac - displays the MAC address of one or more network adapters computer.

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

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

Gpupdate - performing group policy updates.

Graftabl - select a code page for displaying symbols of national alphabets in graphical mode.

H.
Help - does not display full list commands that are used in cmd.

Hostname - displays the computer name.

I.
if is an operator for conditionally executing commands in a batch file.

Ipconfig - displays the subnet mask, default gateway and information about your IP.

Ipxroute is a Nwlink IPX routing management program.

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

Lodctr - updating counter names and explanatory text for an extended counter.

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

Logoff - ending a Windows session.

lpq - displays 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 - creating a folder with extended functionality.

mmc - opens the MMC console window.

Mode - debugging system devices.

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

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

Mountvol - view, create and delete volume mount points.

Move - moving and renaming files and directories.

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

Mqsvc - provides an infrastructure for running distributed applications.

msg - send messages to the user.

Msiexec - launch Windows installer.

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

net is an application package designed to work with the network.

Net1 is the same as net.

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

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

Nslookup - displays information intended for DNS diagnostics.

Ntbackup - launches the archiving wizard.

Ntsd is a command line debugger.

O.
Odbcconf - setting up the Odbc driver.

Openfiles - this command allows the user to list open files and folders that were opened in the system.

P.
Pagefileconfig - setting up paging files and virtual memory.

Path - output 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 emulations.

Perfmon - opens the "Performance" window.

Ping - checks the connection with another computer.

Ping6 - communication test command.

Popd - changes one folder to the one that was saved by the Pushd command.

Powercfg - this command allows you to control the power supply of the system.

Print - print a text file.

Prncnfg - setting printer parameters.

Prompt - change the cmd command line prompt. exe.

Proxycfg is a Proxy connection configuration tool.

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

Q.
Qappsrv - displays available servers terminals on the network.

Qprocess - displays information about processes.

Qwinsta - displays information about terminal sessions.

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

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

Recover - recovery of saved data on a damaged disk.

reg - editing the system registry via the command line.

Regsvr32 - registration server.

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

rem - placing a comment in a batch file.

ren - rename files and folders.

Rename - renaming files and folders.

Replace - replacing files.

Reset is a terminal services reset utility.

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

rd - delete a folder.

Rmdir - deleting a folder.

Route - processing of network route tables.

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

rsm - media resource management using the Removable Storage service.

Runas - using applications on behalf of another user.

Rundll32 - launch standard commands- functions embedded in dll.

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

S.
sc - establishing a connection with NT Service Controller and its services.

Schtasks - create, delete, modify and poll scheduled tasks on a local or remote system.

Sdbinst is a compatibility database installer.

Secedit - automates security configuration tasks.

set - display, assign and delete variables on the command line.

Setlocal - start localizing environment changes in a batch file.

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

sfc - Windows file scan.

Shadow - Allows you to monitor another Terminal Services session.

Shift - changes the contents of the substituted parameters for the batch file.

Shutdown - ending the session, shutting down and rebooting 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 - mapping the drive name to the specified path.

Systeminfo - displays information about system settings.

T.
Taskkill - termination of one or more processes.

Tasklist - shows running programs and processes currently running.

Tcmsetup - installing a telephony client.

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 - processes binary files event tracking log or data streams.

Tracert6 is a version of Tracert for the IPv6 protocol.

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

Tscon - attaches a user session to a terminal session.

Tsdiscon - disable the terminal session.

Tskill - termination of the process.

Tsshutdn - shutdown the server in the prescribed manner.

Type - display the contents of text files on the screen. Typeperf - Prints performance information to the screen or to a log. U Unlodctr - removing counter names and explanatory text for an extended counter. Userinit is a Windows system explorer. V ver - displays information about the Windows version. Verify - setting the mode for checking the correctness of writing files to disk. vol - displays 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 Windows version. Wmic is a scripting tool. X Xcopy - copying files and folder trees.

In order to start working with the command line on Windows, you first need to 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 cmd command

After which the Windows command line will be launched.

Method 2. In Start, write the command CMD or “command line” and select the program icon.

If you need to run as administrator, click right click mouse over the cmd file and select “Run as administrator”.

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

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

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

ASSOC Print or modify mappings based on file name extensions.
ATTRIB View and modify file properties.
BREAK Locks or unlocks enhanced CTRL+C processing in DOS.
BCDEDIT Sets properties in the boot database that allows you to control the initial boot.
CACLS Lists data and modifies access control lists (ACLs) on files.
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 the encoding.
CHDIR Displays the name or moves to another folder.
CHKDSK Diagnoses the drive for errors.
CHKNTFS Shows or changes drive diagnostics during boot.
CLSO clears the display of all characters.
CMD Launches 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 settings.
DISKCOMP Compares and shows the differences between 2 floppy drives.
DISKCOPY Creates a copy of the contents of one flexible storage 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 status and attributes of a device driver.
ECHO Displays text information and changes the command display mode 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 text strings in files.
FOR Loop. Repeats execution of the same command a specified number of times
FORMAT Formats the drive for use with Windows.
FSUTIL Shows and sets file system attributes.
FTYPE Allows you to change and view file types, which are mainly used when matching by file name extensions.
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 graphical mode.
HELP Lists all 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 Configures system devices.
MORE Sequentially displays information in blocks the size of one screen.
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 Stops execution of command line commands and displays informational text.
POPD Restores previous value active folder, which was saved using 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 moves to another folder.
RD Destroys the directory.
RECOVER Revives 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 Replaces 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 programs and sequentially execute the necessary commands according to a given plan
SHIFT Changes the position (shift) of the substituted parameters for the batch file.
SHUTDOWN Shuts down the computer.
SORT Sorts input according to specified parameters.
START Starts a program or command in a new window.
SUBST Purpose given path drive name.
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 command line interpreter CMD.EXE
TREE Displays the drive directories in a convenient visual form.
TYPE Displays the contents of text files.
VER Outputs brief information about the Windows version.
VERIFY Checks for file write errors on the drive.
VOL Displays the labels and serial number of the drive volume.
XCOPY Creates a copy of files.
WMIC Displays WMI on the command line.

Video Windows Command Line (CMD).Part 1

Let's look at all the options:

  1. Run cmd as administrator using the Win+X key combination;
  2. Call the command line via Windows search 10;
  3. Opening a Windows 10 command prompt shortcut with administrator rights;
  4. Command line execution via Windows Utilities;
  5. Calling the Windows 10 command line through the “Task Manager”;
  6. Open cmd from explorer.

Run cmd as administrator using the Win+X key combination

Press the Win+X key combination and 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”, right-click - “Run as administrator”.

Opening Windows 10 Command Prompt Shortcut with Administrator 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, right-click and select “Run as administrator.”

Command line execution via Windows Utilities

To execute the command line, open the Start menu - Windows Utilities- Command line, then right mouse button “Advanced” - “Run as administrator”.

Calling the Windows 10 Command Prompt via Task Manager

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

Open cmd from Windows Explorer

The advantage of this method is that the path in the “cmd” window that opens 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 customization of the Windows 8 operating system. This utility 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 in the system. Some actions (for example, ping checking or tracing) cannot be done at all in any other way. This article describes in detail how to call the console, and also describes the basics of working with it.

Run Dialog Box

The simplest and quick way open the command line using the “Run” dialog. This is another text-based utility that is designed to quick launch programs in Windows by entering their names. There is nothing complicated in working with the dialogue, just follow the instructions provided:

  1. Press the "Win" and "R" buttons on your keyboard at the same time. Using this key combination you can quickly bring 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 entry and open the console.

If you are using operating system version 8.1, 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 dialog described above. Use it if you find the hotkeys inconvenient.

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

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

CMD Windows command line. The need to use the command line

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

The advantage of using a string is that it speeds things up - sometimes enter the right command 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 panel.

The disadvantages of the interface are:

  • manual command entry from the keyboard;
  • the need to run CMD as an administrator (most commands will not run otherwise);
  • enough big list commands that are difficult to remember.

Externally, the command line is very similar to the interface DOS systems. And, although it allows you to decide much more tasks, some commands are the same as the legacy platform. For example, “format”, “cd” and “dir”, necessary for working with folders and drives.

Why is there such chaos in the world? Yes, because the administrator of our system forgot to fulfill his duties. Or I just lost the list of cmd commands from our world. Although this is a somewhat original look at the existing order of things, it nevertheless reflects part of the truth we need: using the command line, you can easily restore order to your computer:

What is the command line

The command line is the simplest tool for managing your computer's operating system. Control occurs using a number of reserved commands and character sets text keyboard without the mouse ( in the operating room Windows system ).

On UNIX-based systems, you can use the mouse when working with the command line.

Some commands came to us from MS-DOS. The command line is also called the console. It is used not only to administer the operating system, but also to manage common programs. Most often, the most rarely used commands are included in this set of commands.

Advantage cmd applications main commands is what is spent minimal amount system resources. And this is important in case of emergency situations when all the computer’s powers are, one way or another, involved.

In cmd the ability to execute and create integers is implemented batch files, representing a certain order of execution of a number of commands (scripts). Thanks to this, they can be used to automate certain tasks ( account management, data archiving and more).

The Windows command shell for manipulating and redirecting commands to certain operating system utilities and tools is the Cmd.exe interpreter. It loads the console and redirects commands in a format that the system understands.

Working with the command line in the Windows operating system

You can call the console in Windows in several ways:


Both methods involve running the console as current user. That is, with all the rights and restrictions that are imposed on its role in the operating system. To run cmd with administrator rights, you need to select the program icon in the Start menu and in context menu select the appropriate item:


After running the utility you can get background information about commands and the format for writing them in the console. To do this, enter the help statement and press “Enter”:


Basic commands for working with files and directories

The most frequently used commands are:

  • RENAME – renaming directories and files. Command syntax:

RENAME | REN [drive/path] original file/directory name | final filename
Example: RENAME C:UsershomeDesktoptost.txt test.txt

  • DEL (ERASE) – used to delete files only, not directories. Its syntax is:

DEL | ERASE [processing method] [filename]
Example: Del C:UsershomeDesktoptest.txt/P

By processing method we mean a special flag that allows you to implement a certain condition when deleting a file. In our example, the “P” flag enables the display of a permission dialog for deleting each file:


More details about the possible values ​​of the “processing method” parameter can be found in technical documentation on the Windows operating system.

  • MD – allows you to create a folder at the specified path. Syntax:

MD [drive:] [path]
Example:
MD C:UsershomeDesktoptest1test2

The example will create a subfolder test2 within the test1 folder. If one of the path's root folders does not exist, it will be created too:

  • RD ( RMDIR) – deletion specific folder or all directories in the specified path. Syntax:

RD | RMDIR [process_key] [drive/path]
Example:
rmdir /s C:UsershomeDesktoptest1test2

The example uses the s flag, which will cause the entire branch of directories specified in the path to be deleted. Therefore, you should not use the rmdir command unnecessarily with this processing key.

In the next section, we'll take a closer look at network cmd commands.

Commands for working with the network

The command line allows you to manage not only the PC file system, but also its networking opportunities. Part network commands The console includes a large number of operators to monitor and test the network. The most relevant of them are:

  • ping – the command is used to monitor the network connection capabilities of a PC. A set number of packets are sent to the remote computer and then sent back to them. The transmission time of packets and the percentage of losses are taken into account. Syntax:

ping [-t] [-a] [-n counter] [-l size] [-f] [-i TTL] [-v type] [-r counter] [-s counter] [(-j host_list | - k node_list)] [-w interval] [target_PC_name]

Example command implementation:
ping example.microsoft.com
ping –w 10000 192.168.239.132

In the last example of the cmd ping command, the request is sent to the recipient with the specified IP address. The waiting interval between packets is 10,000 (10 seconds). By default this parameter is set to 4000:


  • tracert – used to determine the network path to a specified resource by sending a special echo message through the protocol
  • ICMP (Control Message Protocol). After running the command with parameters, a list of all routers through which the message passes is displayed. The first element in the list is the first router on the side of the requested resource.

Syntax of tracer cmd command:
tracert [-d] [-h maximum_hop_number] [-j node_list] [-w interval] [target_resource_name]
Example implementation:
tracert -d -h 10 microsoft.com

The example traces the route to a specified resource. This increases the speed of the operation due to the use of the d parameter, which prevents the command from attempting to obtain permission to read IP addresses. The number of transitions (jumps) is limited to 10 using the set value of the h parameter. By default, the number of jumps is 30:


shutdown [(-l|-s|-r|-a)] [-f] [-m [\PC_name]] [-t xx] [-c “messages”] [-d[u][p]: xx:yy]
Example:
shutdown /s /t 60 /f /l /m \191.162.1.53

The remote PC (m) with the specified IP address (191.162.1.53) will shut down (s) after 60 seconds (t). This will force you to log out of all applications (f) and the current user's session (l).

A few more necessary commands

When working with a PC, a few more commands from the huge list of cmd operators may come in handy. Here are some of them:

  • format – formats a CD in the drive whose name is specified in the parameters. Command syntax:

format volume

When writing the syntax of any command square brackets optional parameters are highlighted.

It confirms next example writing the command:
format e : - the media in drive E will be formatted;

  • set – used to work with environment variables. This cmd command allows you to create, delete and assign a value to variables that can be used while working with the command line. Syntax:

set [] ] string]
Example.

Windows lets you do a lot of different things, with all sorts of tools and utilities, most of which can be easily accessed in . A similar, but more efficient and faster way is to use the Run function, which is available in all Windows operating systems.

Some users believe that this window is intended for geeks or nerds, but in fact this is not the case. It can be used by intermediate and beginners, but only if they know what they are doing and what commands to enter. In short, the tool allows you to become more productive while working on your computer. Therefore, if you are interested in this, or need to know about it, then here is a list of commands for the dialog box Execute.

We've brought you a list of 30 execute commands so you can bypass the endless clicks, thereby speeding up the process of launching utilities and tools in your daily routine. using Windows. It should be noted that in Windows 8 the Run window does not disappear. To open this window, simply press the “Win ​​+ R” key combination on your keyboard and it will appear.

Note: again, to bring up the Run dialog box use Win(Start) + R on the keyboard, then, in the input field, enter any command to access the corresponding tool and press Enter.

List of commands for the Run window

1. "\"

Most users usually open the C drive via Windows Explorer or the My Computer desktop icon. There's nothing wrong with this, there's just a faster way to do it - using the Run dialog box by entering a backslash (slash) into it.

2. "."

The single dot command opens the current user's home folder.

3. ".."

The command of two dots opens the “Users” folder, which is located directly in the C drive.

4.ncpa.cpl

This command opens the folder network connections.

5.appwiz.cpl

Use this command if you want to quickly access Programs and components, where you can uninstall any installed program on your computer.

6.Calc

If you want to open the built-in Windows calculator, then the fastest way to do this is to type the word calc in the run dialog box.

7.CMD

All Windows users sometimes have to deal with the command line. Typing cmd will quickly open a command prompt without administrator privileges.

If Command Prompt is too old for you, try PowerShell instead. To do this, simply type (without a space) in the input line of the Run dialog box, and it will open without administrator privileges.

9.perfmon.msc

Enter this command into the Run dialog box and the utility will launch, which allows you to monitor Windows performance, the effectiveness of programs and gives access to many other useful data.

10.powercfg.cpl

Windows allows you to adjust your computer's power consumption by reducing screen brightness, computer power, etc. Using this command launches the window.

11.devmgmt.msc

This command opens Dispatcher Windows devices , which allows you to manage all the computer hardware. You can also use the command for this hdwwiz.cpl.

12.Regedit

The regedit command opens a window. This is a hierarchical database that stores settings for almost everything on your computer: program settings, drivers, user passwords, Windows settings and everything else.

13. msconfig

Use this command to open Windows system configurations, where you can configure boot and startup settings. services, services, etc.

14.sysdm.cpl

Opens system properties

15. netplwiz

This command is useful for computers with multiple . Administrators can open any account and customize it however they want. And other users can open and edit only their Personal settings user.

16.firewall.cpl

Want to quickly disable or enable Windows Firewall? - just enter firewal.cpl in the execute field, and the firewall settings window will appear right in front of you.

17. wuapp

If you want to check or configure Windows update settings, use this command.

18.services.msc

Type services.msc and press Enter, a window will open Services, where you can easily configure the settings for each service individually.

19. msinfo32

If you want to quickly get information about the system, then use the msinfo32 command and you will have access to all the information about the system, including hardware and software.

20.sdclt

33. utilman

Above we showed you how to open on-screen keyboard on Windows. But besides this, there are other useful Windows utilities such as, magnifier, screen reader, etc. You can access them using this command.

34. write

Last but not least is the write command, which opens the built-in Windows editor WordPad(Notebook).

The Run tool in Windows, including its commands, is one of the most the best means, which you can find on Windows. In addition to the commands listed above, there are hundreds of other commands that provide access to various operating system tools and utilities.

Windows for communicating with the computer in a language it understands. However, programs are still launched using the regular command line (console). It is the founder of the interface and a means of communication between the user and the PC. The essence of the work is that commands are entered into a line using the keyboard. This management method is often used by system administrators. Regular users should also know basic commands.

Console - what is it?

Launch Windows programs carried out using the console - command line. This is one of the types of text interface that has become available to many MS DOS users. Enter commands into the command line at manual mode. Many people consider the console to be an outdated management method, which is often needed by users and system specialists. The command line is a black window with a green location label and a blinking cursor. The corresponding command for the computer is entered into the specified location.

The Command Prompt is an incredibly convenient window for solving many problems. However, to interact with the console you will need knowledge of writing commands. The benefit is that they reduce turnaround time. complex actions. To do this, just enter the desired task in the line.

Why are teams needed?

Command line commands are necessary to establish user interaction with the operating system and computer. Working with the command line is an urgent need for specialists who deal with system administration. The console is a small part of what you can use as a tool to work with Windows. The command line is convenient, fast, and can be used to easily solve many issues. Working with it will require knowledge of commands and skills that will lead to a positive result.

CMD - there are a huge number of commands. Practice will help you remember the main ones. Using commands, you can change, edit files, create, restore partitions, configure, run, restart the computer, delete folders, copy and much more. Experts advise making a list of important commands in alphabetical order in a notepad. It's convenient and helps you quickly find your way around.

How to start?

Windows command line commands run without much difficulty. Despite the graphical interface, the console has always been and is main element computer control. Console basics will come in handy to the average user. To launch the command line, open the menu: “Start” - “Run”. Enter the word “Cmd” in the window that appears, press “Enter”. If the version of the operating system does not have the “Run” item, then the combination “Win ​​+ R”.

In Windows 7, right-click on “Start”, go to “Properties” - “Customize”, check the box next to “Run”. If you need to open the console as an administrator, enter the command “Cmd” in the “Start” search bar, right-click on the “Cmd” program, select “Run as administrator.” It is convenient to create a shortcut on the desktop that will open the console. Appearance Row windows can be changed according to the user's wishes (color, font, location).

Sometimes you may have problems copying and pasting text into the command line. In the case of the console, the clipboard buttons do not work. If you need to make a copy, right-click on the window, select "Mark", select the text with the left mouse button, and then right-click. To insert text or text, right-click the Paste command line window. In addition, you can work with the console using hot keys on the keyboard and the up/down arrows.

Basic

The main commands for the command line help the user to solve tasks of paramount importance in a short time.

Additional

The list of commands, which is auxiliary, is often used by system specialists to work with information located on the hard drive.

  • The “Format” command deletes data from the hard drive and prepares it for copying. As an example of a formatting command: “FORMAT disk:/FS:FAT (file system).”
  • The "FC" command compares files with each other.
  • "IPCONFIG" - shows full information about Network settings, and also reports the type network connection"IPCONFIG/ALL".
  • The PING command will check the site's availability. Example: “PING fb.ru”. The presence of numbers in the response indicates that everything is in order and the site is available for visiting.

Commands for the Network

Web command line commands let you surf the Internet efficiently, fix errors, and configure settings. If you need to find out your IP address, enter the “Ipconfig” command in the console. In different variations of Internet connection, you can find out complete information about the Network. After entering, the user will receive a list of network connections that are used by the computer. If the user's computer is connected to the Internet via wireless communication Wi-Fi, the main gateway will be selected to communicate with the router. The user can access its settings through a command entered into the console. If the computer is connected to a local network, you can find out about the IP address through the command line with the corresponding request.

Using the “Ping” and “Tracert” commands, the user can quickly find and fix problems with the Internet and browser. The "Netstat-an" command displays network connections and ports. This is a very useful program because it displays various network statistics. The "-an" switch opens a list of available network connections, ports and IP addresses. The “Telnet” command connects to servers of the same name. If you need to obtain information about network settings, use the “Ipconfig” command. Without additional parameters, the command displays IP address information. If you need specific information, add the “All” command. Entering “Ipconfig/flushdns” into the line clears the cache in Windows.

Filters

Filters are command line commands that are used with the pipe redirection symbol. They are needed to sort, view and select information from other teams. Filters organize, divide, and highlight part of the information that passes through them. Among these commands are the following:

  • “More” - displays the contents of the file;
  • “Find” - searches for specified characters;
  • “Sort” - sorts files alphabetically.

In order to send data from a file, the “L” symbol is used, and the “I” channel is used to send data to the output.

Shutdown

In addition to the built-in CMD, the console is used to launch regular programs. To enter it, just type the right combination letters in the Run window. If you need to view the results, it is better to use a string. “SHUTDOWN” is a command that shuts down Windows if for some reason the Start button does not work. It is useful when the computer is performing a task that cannot be interrupted (and the user needs to leave and not leave the computer on for a long time). The device will turn off correctly upon completion of work on its own. It's better than setting a timer.

Dial next command"Shutdown-s-t-1300", press "Enter". The numbers are the time in seconds after which the device will turn off. The command to restart the computer from the command line is as follows: "Shutdown -r". Click "Confirm" to activate. “At” command - starts the PC at the time specified by the user. This utility reads and groups jobs in the Windows operating system.

Formatting

The list of commands for the console is huge. Many of them are harmless and simple, but there are special ones among them that require caution on the part of the user. Be careful! Sometimes it is necessary to completely format a disk or flash drive. The command to delete all data looks like this: “Format C”, auxiliary parameters “/fs” - determine the location of the file system of the formatting disk, “/v” - sets the volume label, “/a” - the cluster size. Do not execute the formatting command if you are not sure of your actions and do not know why it is needed. The command deletes all information from the PC!

Examination

Some command line commands are designed to check disks for system errors. The "CHKDSK" command without additional parameters displays information about state of rigid disk. If errors are found, enter an additional “/f” to correct them. Before checking the drive, lock it. If the console is full of commands, enter “c/s” into the line to clear the screen.

The system files will be checked by the “Sfc” command. With its help you can restore damaged files. The command is supplemented with the parameters “/scannow”, “/scanonce”, “/scanboot”, which check and correct system errors in files.

Other

It is impossible to know all the commands on the line, but some of them will be useful to the user. For example, the "Assoc" command changes the association between extension and file type. If the user wants to find out detailed information about the operating system and the state of the computer, he should type “Systeminfo”. Using the system registry editor "Regent" you can change hidden settings OS. However, if you don’t know what’s what, it’s not recommended to do this due to the risk of breaking Windows. It is easy to call the system configuration - a special service by entering "Msconfic" into the command line. If you want to learn more about the commands, write “Help” in the console line, taking into account that the operating system is the seventh or eighth version of Windows.

Experts include network, system and filters as useful commands for the user. The "At" command consists of a whole set of commands that are used to install, reinstall, and configure the modem. It is also considered a team planner. With its help, you can change, cancel, configure tasks for a remote or local computer. In the Windows operating system, it is better to use the "SCHTASKS" utility instead of the "At" command. Its capabilities are much wider.







2024 gtavrl.ru.