So what is command line? This is a part of Windows with which you can enter various commands on the computer. As a rule, only advanced users access the command line, but this is not a reason to remain silent about it, so I decided to dedicate this post to the possibilities and properties command line.

Why do you need a command line?

You ask, why should you know about the possibilities of the command line, if there is a Windows graphical interface? But now I will list the reasons why you should use the command line:

Memory consumption is less than when using the menu system;

Typing any application's command is faster than if the command's GUI were used;

The command line can execute a text file with all sequential commands, which is much faster than executing them sequentially.

Where is the command line used?

You can use command line in operating systems, computer games and other programs. In fact, the command line was originally used in games if debugging was needed. But even now, even with a graphical interface, using the command line, you can change the game settings faster.

What are the benefits of the command line?

Almost instant access to the commands of the various files used;

To call any command, a small number of clicks is enough;

You can manage programs that do not have a graphical interface;

You can remotely connect to a computer at a minimum spending traffic;

There is more text on the page than in the graphical interface.

Are there any cons of the command line?

Difficult for users who are used to working with a graphical interface;

If there is no automatic addition, then it will be difficult to enter long commands;

Has no analogues.

How to open command line?

1. To open a command prompt in Windows7/XP, do the following:
Start => All Programs => Accessories => Command Prompt .

or press the keyboard shortcut "Win + R" .

in field "Open" enter the following command:

A black command prompt window will open with the inscription:

C:\Users\Administrator>, where Administrator is the name of the current user.

To view a list of command line commands, type help

and press the Enter key.

To see more information about each of these commands, enter the following command at the command prompt
help commandname and press ENTER .

For example:

List of command line commands:

ASSOC→ Display or change associations for file name extensions.

ATTRIB→ Display and change file attributes.

BREAK→ Enabling and disabling the processing mode of the key combination CTRL+C .

BCDEDIT→ Sets properties in the boot database to control bootstrap.

CACLS→ Display and edit file access control lists (ACLs).

CALL→ Calling one batch file from another.

CD

CHCP→ Display or set the active code page.

CHDIR→ Show the name or change the current folder.

CHKDSK→ Check disk and display statistics.

CHKNTFS→ Display or change the check disk progress during boot.

CLS→ Screen cleaning.

cmd→ Launch another Windows command line interpreter.

COLOR→ Set the default foreground and background colors.

COMP→ Compare the contents of two files or two sets of files.

COMPACT→ Display and change file compression on NTFS partitions.

CONVERT→ Convert FAT to NTFS disk volumes. You cannot convert the current active disk.

COPY→ Copy one or more files to another location.

DATE→ Display or set the current date.

DEL

DIR→ Display a list of files and subfolders from the specified folder.

DISKCOMP→ Compare the contents of two floppy disks.

DISKCOPY→ Copying the contents of one floppy disk another.

DISKPART→ Display and set disk partition properties.

DOSKEY→ Editing and re-invoking command lines; creating macros.

DRIVERQUERY→ Display the current status and properties of the device driver.

ECHO→ Display messages and switch the display mode of commands on the screen.

ENDLOCAL→ End local environment changes for the batch file.

ERASE→ Delete one or more files.

EXIT→ Exit the program CMD.EXE (command line interpreter).

FC→ Compare two files or two sets of files and display the differences between them.

FIND→ Search text string in one or more files.

FINDSTR→ Search for strings in files.

FOR→ Run the specified command for each of the files in the set.

FORMAT→ Format the drive for Windows.

FSUTIL→ Display and set file system properties.

FTYPE→ Display or change the file types used in matching by file name extensions.

GOTO→ Transfer control to the marked line of the batch file.

GPRESULT→ Display Group Policy information for a computer or user.

GRAFTABL→ Allows Windows to display the extended character set in graphics mode.

HELP→ Displays background information about Windows commands.

ICACLS→ Display, change, archive or restore ACLs for files and directories.

IF→ Operator for conditional execution of commands in a batch file.

LABEL→ Create, modify and delete volume labels for disks.

MD→ Create a folder.

MKDIR→ Create a folder.

MKLINK→ Create symbolic and hard links

MODE→ Configuring system devices.

MORE→ Sequential output of data in parts of one screen.

MOVE→ Move one or more files from one folder to another.

OPENFILES→ Display files opened on shared folder remote user.

PATH→ Displays or sets the search path for executable files.

PAUSE→ Pauses the execution of the batch file and displays a message.

POPD→ Restores the previous active folder value saved with the PUSHD command.

PRINT→ Prints the contents of a text file.

PROMPT→ Changes the prompt on the Windows command line.

PUSHD→ Saves the active folder value and moves to another folder.

RD→ Deletes a folder.

RECOVER→ Recovers readable data from a bad or damaged disk.

REM→ Puts comments in batch files and the CONFIG.SYS file.

REN

RENAME→ Renames files or folders.

REPLACE→ Replaces files.

RMDIR→ Delete folder.

ROBOCOPY→ Improved tool for copying files and directory trees

SET→ Shows, sets and removes Windows environment variables.

SETLOCAL→ Start localizing environment changes in a batch file.

SC→ Displays and configures services (background processes).

SCHTASKS→ Executes commands and launches programs on schedule.

SHIFT→ Changing the position (shift) of the inline parameters for the batch file.

SHUTDOWN→ Local or remote computer shutdown.

SORT→ Sort input.

START→ Run a program or command in a separate window.

SUBST→ Assign a drive name to the specified path.

SYSTEMINFO→ Display information about the system and configuration of the computer.

TASKLIST→ Display all running tasks, including services.

TASKKILL→ Terminating or stopping a process or application.

TIME → Output and setting the system time.

TITLE→ Assigning a window title to the current session of the CMD.EXE command line interpreter.

TREE→ Graphical display of the directory structure of a disk or folder.

TYPE→ Display content text files.

VER→ Display information about Windows versions.

VERIFY→ Set the mode for checking whether files are written to the disc correctly.

VOL→ Display the label and serial number of the volume for the disk.

XCOPY→ Copy files and directory trees.

WMIC→ Display WMI information in an interactive environment.

So, the command line console is present in all versions of Windows operating systems. Early versions of the OS supported MS-DOS mode directly, allowing simple commands to be executed directly from the console. Representatives of the NT family, such as Windows 2000 or Windows Server 2003, work on completely different principles, but MS-DOS is also supported in them, but through virtual machine(NT Virtual DOS Machine, NTVDM), which allows you to control and administer system resources directly from the command mode console. The command mode interpreter is the cmd.exe program, which is launched through the Start -> Run menu. In addition, to launch the console, you can use the menu item "Start -> All Programs -> Accessories -> Command Prompt".

By launching the command mode console, the user can manage the resources of both the local system and the resources of a remote machine. There are commands that monitor the system and identify critical places in the server settings. The difference between working from the command line is complete absence large and unwieldy graphics utilities. Command line programs allow more fine tuning in the form of key parameters specified to the right of the command itself.

With the help of special script files (sets of commands that are executed sequentially or in a programmed order), the administrator can minimize the execution of routine daily operations. Existing modern utilities can run such scripts at specified intervals without the presence of a system administrator.

The administrator himself can execute both single commands and a list of commands using special control characters (&, |). For example:

Command 1 & Command 2 - Command 1 will be executed first and only then Command 2; Command 1 && Command 2 - only after the successful completion of Command 1 will Command 2 be launched.

It is possible to redirect the stream output by the program directly to a text file for further processing. To do this, you must use the control character ">" and the name of the text file. An example of outputting the contents of the current directory to the Report.txt text file using the dir command is shown below:

Dir>Report.txt

An administrator can run multiple instances of the console by calling cmd.exe from the command line. Using a nested console allows you to work with environment variables operating system without any consequences for the entire system as a whole, since after the nested console is closed, changes to environment variables are not saved. The setlocal, endlocal, and set commands are used to control this process.

There are many commands and utilities in modern operating systems. Remember so many different programs, and even more so their parameters
very difficult, therefore one of the most important parameters for each program is a combination of characters /?. After executing a command with this parameter, the user will receive a comprehensive message about the application of the utility and the syntax of its parameters.

Please note that in the figure on the left upper corner the next page uses complex syntax. So, right after the shutdown /? after the special separator "|" there is a more command, which allows you to display information on the screen not entirely, but in certain portions, convenient for further reading.

To close the command line console, you must execute the exit command.

Who is in charge here?

According to their capabilities, console programs are divided into:

  • operating system management commands are commands such as shutdown or taskkill;
  • network commands - net and ipconfig;
  • commands for system monitoring - tasklist and systeminfo;
  • commands for file system support - dir, mkdir, copy;
  • service commands hard drives- defrag and diskpart;
  • commands to support the directory service (Active Directories) - addrep and dsadd;
  • auxiliary commands, this section includes various utilities for creating scripts, configuring printers, working with environment variables, etc.

Let's take a look at typical representatives of each group and allow ourselves to give some recommendations on the use of the commands included in them.

Monitoring and diagnostic commands

Monitoring commands such as systeminfo and tasklist are used to identify hardware and software problems. These utilities first appeared only in the operating room. Windows environment Server 2003, so administrators have not yet fully appreciated functionality these commands. So, for example, now you do not need to go to the "Properties" tab of the "My Computer" icon - the systeminfo command will print on the console screen basic information about all system components with full decryption. The /s option will display information about any remote computer. For example, to find out the configuration of the TESTSERVER computer, run the following command:

Systeminfo /s TESTSERVER

And the tasklist utility will show the processes running on your computer.

The tasklist utility allows you to query systems connected to a network. The /v option allows you to get detailed listings with useful information, including usernames, and the /t option shows the processes that loaded a particular dll file. Another useful utility - openfiles - allows you to get information about all open files of the local and remote operating system. AT previous versions Windows operating systems had to use the oh.exe command, in modern versions it is enough to execute a command in the console command line that sets the monitoring mode for all open system files:

Openfiles /local on

The user will get information about all open files on the system using a command with a simple syntax:

openfiles

The openfiles command with the /query /v options shows which users have started the processes that opened the files. With the help of other key parameters, you can set different mode information output.

Operating system commands

Windows Server 2003 provides administrators with new commands that help them not only diagnose the system, but also manage it. These commands include the shutdown utility. The following can be used as key parameters of this utility:

  • /s - complete regular shutdown of the system;
  • /p - power off;
  • /f - shutdown of active applications;
  • /d - transition to the low power mode;
  • /I - end the session without shutting down the computer.

The Shutdown Event Tracker, which collects and diagnoses all shutdowns performed by the administrator, acts as a tool that registers all regular shutdowns of the computer. It is also possible to shut down the system with an indication of the reason, for this you must use the / d switch.

The taskkill command, analogous to the kill command in operating systems of the *nix family, allows you to "kill" a hung application. Together with the tasklist command, these utilities provide a powerful tool for quickly interfering with the execution of applications that pose a potential threat to server performance. Of the parameters of this command, it is necessary to note the /pid key, which allows you to terminate the process by its unique identifier, and the /im key - to terminate the application with the specified name. The following example terminates processes with IDs 1000 and 1240:

Taskkill /pid 1000 /pid 1240

Commands for servicing hard drives

Optimization hard drive allows you to execute the defrag command. The utility can defragment disks with FAT, FAT32 and NTFS file systems. Defrag works equally well with both dynamic and basic disk types. The syntax for calling this command is as follows:

Defrag disk [ -a j [ -f ] [ -v ] [ -? ]

The -a parameter provides only for the analysis of information on the disk, the -f parameter - information optimization, including in the absence of the necessary disk space to create temporary files, and the -v option to print a report on the optimization progress. Do not forget that for a successful defragmentation, the disk must contain at least 15% free space.

The fdisk command is no longer supported by the operating system kernel. Windows systems Server 2003. It was replaced by the diskpart command, also designed for servicing hard drives. Partition a disk, create logical disks, delete them - these are just some of the tasks solved by this utility. Basically, the diskpart command is focused on working with special script files that describe the procedures for servicing hard drives. This is how the call to this command looks like for the script file Scriptl.txt:

Diskpart /s Scriptl.txt

Each line of such a file is an instruction for some operation. So, for example, gives the command to create a new partition with a specific string size

Create partition logical size=2048

Network commands

Among the network commands, I would like to highlight two utilities. The first is the ipconfig command, the second is netstat. System administrators use these commands not only to monitor the network, but also to protect against dangerous programs trying to take control of the system.

Using the ipconfig utility, the user can find out the network address of his computer, and by calling this command with the /all parameter, get full information about the network configuration on local computer. The /renew option allows you to change network settings without rebooting the entire system.

If you notice that something is wrong with your computer, then the netstat command will help in this case, which will not only point to open network ports, through which attackers could connect to your system, but also identifies processes running on the server without your knowledge. So, the /o switch displays information about the process ID (PID) using one or another network connection. It is possible to see which computers on the network are interacting with your local operating system.

Directory Services Commands

The entire network consists of components and is a complex hierarchical structure built in the form of a tree. The objects of such a system are sites, subnets, servers, computers, groups, users, contacts, shared network devices.

To monitor such a complex structure, the operating system provides the dsquery command, which is designed for advanced search of directory service components. Also, this command can be used to display information about the properties of selected components (key -attr). The -scope, -subtree, -onelevel, -base parameters determine the nesting level of the search, and the -filter key allows you to use the search filter.

The dsmod command can help you if you need to modify one or more accounts for a selected directory service component. For example, you can remove a user from a group or assign him New Password. Change example account for user TestUser is below:

Dsmod user "CN=TestUser,CN=Users,DC=bigtex,DC=net" -pwd [email protected]-mustchpwd yes

The dsmove command moves an object within the current domain. Using the -newname and -newparent switches, you can set a new name for the object and change its location.

Commands for file system support

A description of some frequently used commands for working with files and directories is presented in the table. The deltree command, which performed a cascading deletion of folders and files in them, is now replaced by rmdir with the /s switch.

Little secrets of a big system

Changing the command line prompt

Find the key in the registry: Create in this key string parameter"PROMPT" with type (REG_EXPAND_SZ) and assign one of the following values:

  • $B - vertical bar"I";
  • $D - current date;
  • $G - greater than sign ">";
  • $1_ - less than sign "<»;
  • $N - current disk;
    $P - current drive and path;
  • $Q - = "=";
  • $T - current time;
  • $V - Windows version;
  • $$ is the dollar sign "$".

After the reboot, you will see the prompt in the form you defined.

Autocommand set

To enable auto-typing of commands by pressing the "Tab" key, find the key in the registry:

Then set the value of the CompletionChar parameter to 9, which corresponds to the key identifier "Tab", close the registry and restart the computer. In the console window, while typing part of the command name, you can now press the "Tab" key, and Windows will automatically substitute the required command.

Console color change

Find the key in the registry:

Change the DefaultCoior parameter. The -F0 value will display black text on a white background, while the IE value will surprise you with a yellow and blue coloring of the console.

Quick launch of the command line console from the context menu

Find the key in the registry:

Add "CommandPrompt -> Command" subsections to it. Set the Default parameter of the Command key to "cmd.exe /k cd "%1"".

Set the Default parameter of the Command Prompt key to "Open Command Prompt".

By right-clicking on any folder in Explorer, you can select the Open Command Prompt command, which will launch a command line console in the desired directory.

Conclusion

OK it's all over Now. We talked about the basics of working with the console. Then we give you the opportunity to explore the functionality and diversity console commands. Just do not forget the cherished key /?, and the rest will come with time and experience

Save yourself so you don't lose!

How to control a computer without a mouse? To do this, you can run the command line windows cmd with a combination win keys r, 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, do not notice 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 - mapping MS - DOS applications that are not recognized by the system 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 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 no full list 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 emulations.

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 servers terminals 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 system registry via command line.

Regsvr32 - registration server.

relog - creates new magazine performance from what you already have.

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 control computer.

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 - toolkit tester Windows controls. 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 them on the same computer an infinite number. 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 Outputs text 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 Swaps files in places.
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 given 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 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'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. Command line call via Windows search 10;
  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 button 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 "Run a new task" item, enter "CMD" in the window that opens, 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 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 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 simplest and fast way open a command line - using the "Run" dialog. This is another text-based utility that is designed to quick start 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 the 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 detailed information for any of them, type " help commandname ".

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

The cmd line, which is a standard Windows platform tool, is no different in different versions operating systems - and 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.

12.02.15 21.3K

Why is there such chaos in the world? Yes, because the administrator of our system forgot about his duties. Or 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 clean up your computer:

What is command line

The command line is the simplest tool for managing a computer's operating system. Management takes place with the help of a number of reserved commands and a set of characters of the text keyboard without the participation of the mouse ( in Windows operating system).

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

Some of the 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 regular programs. Most often, the most rarely used commands are included in such a set of commands.

The advantage of using basic cmd commands is that it consumes a minimum amount of system resources. And this is important in case of emergencies, when all the power of the computer, one way or another, is involved.

cmd implements the ability to execute and create entire batch files, which are a specific order in which a number of commands (scripts) are executed. Because of 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 can understand.

Working with the command line in the Windows operating system

You can call the console in Windows in several ways:

Both methods involve launching the console as the 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 help information about commands and their format in the console. To do this, enter the help statement and press " Enter":

Basic commands for working with files and directories

The most commonly used commands are:

  • RENAME - rename directories and files. Command syntax:

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

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

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

The processing method is a special flag that allows you to implement 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 possible values parameter "processing method" can be found in the technical documentation for 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 in the folder test1 . If one of the root folders of the path does not exist, then it will also be created:

  • R.D. ( RMDIR) - delete a 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 the directories specified in the path to be deleted. Therefore, you should not unnecessarily use the rmdir command with this processing switch.

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

Network Commands

The command line allows you to manage not only the PC file system, but also its network capabilities. The console network commands include a large number of operators for monitoring and testing the network. The most relevant of them are:

  • ping - the command is used to monitor the possibilities network connection PC. Remote computer a set number of packets are sent and then sent back to them. Packet transmission time and loss percentage are taken into account. Syntax:

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

Command implementation example:
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 destination with the specified IP address. The interval between packets is 10,000 (10 sec). By default, this parameter is set to 4000:

  • tracert - used to determine the network path to the 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 path passes is displayed. The first element in the list is the first router on the side of the requested resource.

The tracer syntax of the cmd command is:
tracert [-d] [-h max_hops] [-j host_list] [-w interval] [target_resource_name]
Implementation example:
tracert -d -h 10 microsoft.com

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

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

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

Hi all. In this article, we will talk about topics such as:

Command Prompt (CMD) is a separate program that allows the user to directly interact with the operating system. Command line is based on an environment in which applications and utilities are run using a text-based interface, and the result of the execution is displayed on the screen.

Command line Windows uses the command interpreter cmd.exe, which allows you to download applications and directs the flow of data between them, in other words, translates user commands into a form understandable to the system. command line console integrated into all versions of Windows OS. At first sight command interface frightens the user spoiled by the graphical interface of the same Windows, but as a rule command interface, is much faster and has a lot of additional features that cannot be implemented in the graphical interface.

Launch Methods:

  1. Start / All Programs / Accessories / Command Prompt.
  2. Start / Run / in the line we enter cmd.exe
  3. Run from system folder: C:\WINDOWS\system32\cmd.exe

cmd commands.

Below I will give you a plate with a complete list command line commands, and after the tablet we will analyze in more detail the main cmd commands.

Command Description
ASSOC Display or change associations for file name extensions.
AT Execute commands and run programs on schedule.
ATTRIB Display and change file attributes.
BREAK Enable/disable the processing mode of the CTRL+C key combination.
CACLS Display/edit access control lists (ACL) to files.
CALL Calling one batch file from another.
CD
CHCP Display or set the active code page.
CHDIR Display the name or change the current folder.
CHKDSK Checking the disk and displaying statistics.
CHKNTFS Display or change the check disk run during boot.
CLS Screen cleaning.
cmd Launching another Windows command line interpreter.
COLOR Sets the default text and background colors.
COMP Compare the contents of two files or two sets of files.
COMPACT Display/change file compression on NTFS partitions.
CONVERT Converting FAT to NTFS disk volumes. You cannot convert the current active disk.
COPY Copy one or more files to another location.
DATE Display or set the current date.
DEL
DIR Listing files and subfolders from the specified folder.
DISKCOMP Comparing the contents of two floppy disks.
DISKCOPY Copying the contents of one floppy disk to another.
DOSKEY Editing and re-invoking command lines; creating macros.
ECHO Displaying messages and switching the mode of displaying commands on the screen.
ENDLOCAL End of local environment changes for batch file.
ERASE Delete one or more files.
EXIT Exiting the program CMD.EXE (command line interpreter).
FC Compare two files or two sets of files and output the differences between them.
FIND Search for a text string in one or more files.
FINDSTR Finding strings in files.
FOR Run the specified command on each of the files in the set.
FORMAT Formatting a drive for Windows.
FTYPE Display or change the file types used in file name extension matching.
GOTO Transfer control to the marked line of the batch file.
GRAFTABL Allows Windows to display the extended character set in graphics mode.
HELP Displays help information about Windows commands.
IF Conditional execution statement for commands in a batch file.
LABEL Create, modify, and delete volume labels for disks.
MD Create a folder.
MKDIR Create a folder.
MODE Configuring system devices.
MORE Sequential output of data in parts of one screen.
MOVE Move one or more files from one folder to another.
PATH Display or set the search path for executable files.
PAUSE Pause the execution of a batch file and display a message.
POPD Restore the previous value of the current active folder saved using the PUSHD command.
PRINT Printing the contents of text files.
PROMPT Changing the prompt on the Windows command line.
PUSHD Save the value of the current active folder and move to another folder.
RD Deleting a folder.
RECOVER Recovery of readable information from a bad or damaged disk.
REM Putting comments in batch files and the CONFIG.SYS file.
REN
RENAME Renaming files and folders.
REPLACE File replacement.
RMDIR Deleting a folder.
SET Listing, setting and removing Windows environment variables.
SETLOCAL Start local environment changes for a batch file.
SHIFT Changing the content (shift) of inline parameters for a batch file.
SORT Sort input.
START Launching a program or command in a separate window.
SUBST Matches the specified path with a drive name.
TIME Output and setting the system time.
TITLE Assigning a window title to the current session of the CMD.EXE command line interpreter.
TREE Graphical display of the folder structure of a given drive or a given folder.
TYPE Displaying the contents of text files.
VER Display information about the version of Windows.
VERIFY Sets the mode for checking the correctness of writing files to disk.
VOL Displays the label and serial number of the volume for the disk.
XCOPY Copying files and folder tree.

Command line commands.

Now let's talk in more detail about the most commonly used commands, but first I'll tell you a little about the keys that can be used with commands for a more functional action. For example, let's take the RD (delete directory) command, if it is applied to an empty folder, then it will be deleted, but if there are files in the folder, then nothing will happen. So, in order to delete a folder along with the files in it, you need to use the key together with the RD command /s.

That is, for example, there is a kat directory and find any files in it, in order to delete the directory along with the files, you need to write RD/s cat. The list of keys to any command can be found by typing the command name with a slash followed by a question: command_name/?.

Basic commands for working with directories:

  • MD - Create directory. Syntax: (MD directory name, it is possible to specify the location path).
  • RD - Delete directory. Syntax: (RD directory name, it is possible to specify the location path). Note, RD without keys allows you to delete only an empty directory.
  • CD - Change current directory. Syntax: (CD directory name, it is possible to specify the location path). CD\ - Change to the root directory. CD.. - Changes to the parent directory.
  • DIR - View a directory as a list. Syntax: (DIR directory name, it is possible to specify the location path).
  • TREE - Display directories in a graphical representation. Syntax: (TREE directory name, it is possible to specify the location path).
  • MOVE - Move \ Rename directory. Syntax: .
  • XCOPY - Copy directory structures. Syntax: (XCOPY what_copy where_copy, it is possible to specify the location path).

File commands:

  • COPY CON - Create a file. Syntax: (COPY CON file_name_with_extension, it is possible to specify the location path).
  • TYPE - Display the contents of the file on the screen. Syntax: (TYPE file_name_with_extension, it is possible to specify the location path).
  • DEL - Delete file. Syntax: (DEL file_name_with_extension, it is possible to specify the location path).
  • COPY - Copying a file\Combining files. Syntax(copy): (COPY what_copy where_copy, it is possible to specify the location path). Syntax (combine): (COPY file_name + file_name + file_name ... union_file_name, it is possible to specify the location path).
  • EDIT - Create\Edit a file. Syntax: (EDIT file name, it is possible to specify the location path).
  • MOVE - Move\Rename file. Syntax: (MOVE what_we move where_we move, it is possible to specify the location path).
  • REN - Renaming files. Syntax: (REN what_rename to what_rename, it is possible to specify the location path).
  • FC - Compare files. (FC file_name file_name file_name…, it is possible to specify the location path).

System commands:

  • CLS - Cleaning the screen.
  • DATE - View and display changes to the current date.
  • VER - Output information about current version operating system.
  • VOL - Display information about the volume-logical partition of the disk.
  • SYSTEMINFO - Display information about system configurations.
  • EXIT - Exit from the command line.

These were the most used command line commands.

This concludes this article, I hope you have fully understood the topics: CMD Commands, Command Line Commands, Command Line.