Where is the command line located?
The main command line file is the console cmd.exe translating user commands into an understandable system view, is located in the folder with the installed OS along the path: <буква_системного_диска>: WINDOWS system32 cmd.exe
How to start / open / call the command line?
These methods of launching the command line are relevant for all versions, including those that I consider on my site - windows XP, 7, 8
1) Start - All programs - Accessories - Command line
2) Start - Run - enter cmd.exe
3) keyboard shortcut Win + R - enter cmd
4) Launch from the system folder: <буква_системного_диска>: WINDOWS system32 cmd.exe
In order to run command prompt as administrator, 1 and 4 methods are suitable, you need to click RMB on the shortcut and select "Run as Administrator" in the menu.
Commands / Options / Command Line Keys .
You can learn command line commands directly in it by typing help and pressing the Enter key (after you finish entering all the commands you need to use Enter (ENTER)).
I will not go too deeply, because for this it is better to write a separate article. I will give only a small command line example.
Suppose I have folder 123 on drive E, and in it is the text file test.txt.
Now I want to make this file hidden without going to this drive and not "seeing" this file with the folder.
The team responsible for the "System" attribute is attrib. And she has her own attributes (already teams). You can even look at the screenshot above, I showed it there on an example.
Of all its attributes, I need only two - this is its setting and the attribute itself. Responsible for this + and s.
So my command will be as follows: attrib + s e: /123/test.txt. This is how the correct result will look:
Oh. I just noticed that instead of Hidden, I made it System, and I wonder why it did not disappear in the folder. I specifically did not begin to remove screenshots and edit the article in order to show you how to correct such a mistake (as I did). Good information too.
How to edit text in a command window?
The fact is that standard methods using the keyboard shortcuts Ctrl + C and Ctrl + V on the command line do not work.
Here you need to use RMB - Right Mouse Button.
In order to paste text on command line, just click RMB anywhere on the command line, then select Embed.
In order to copy some text from the command line You can use one of two methods:
1) RMB - Select All
All text will stand out, but you can immediately select whatever you want, just as usual holding down LMB
2) RMB - Flag
A blinking cursor will appear at the beginning of the line, which can be controlled by the "arrows" on the keyboard. And when the shift button is pressed, select the text, controlling the “arrows” on the keyboard as well. Or select again with the mouse.
if you wish, you can change command line settingsby selecting the menu item above "Properties"
Other Windows Command Line Resources:
Windows command line setup. - How to change the background color, character color, size and location of the command line window. Copy and paste text in the console window. How to configure the addition of file and directory names when typing at the command line. Using function keys.
Working with the Windows command line - The basic techniques used when working on the Windows command line.
Windows batch files - General principles for using environment variables in batch files. Processing command line options. The use of labels, transitions and cyclic data processing. Practical examples of solving system administration tasks.
Launching applications as administrator without UAC request - How to start an application or batch file from a batch file without prompting for UAC UAC
Work with the network on the command line. - A detailed description of the CMD Windows commands for working with the network and examples of their use.
If you want to share a link to this page on your social network, use the "Share" button
How to run the command line
In Windows 10, it’s not immediately obvious to find the command line, so read this article about the different ways to launch the console in this OS.
There are several ways to run a command line on a Windows operating system, here are the simplest ones:
- From the "Start" menu, go to "Programs" ("All Programs"), and then to "Tools" (in Windows 7 - "Accessories"), select the application "Command Prompt".
- In the search field, enter “cmd” (without quotation marks), the command line will appear among the opened results.
- After pressing “Win” + “R” on the keyboard, in the “Run” window, enter the command to launch the command line “cmd” (without quotes).
In normal mode, the command line is run on behalf of the user. To perform certain actions on the command line, elevated computer administrator privileges are required. In this case, the command line must be run as administrator. Read the article on how to run the command line as administrator in different versions of the Windows operating system.
How to run a command on the command line
Work on the command line is very simple: the user enters a text command, and then presses the Enter key. If you need to enter several consecutive commands, repeat this operation several times.
After starting the command line, the version of the Windows operating system and the place where the user is currently located are displayed in the window of the command line interpreter. When started in normal mode, this is the address of the user profile on the system drive.
When you run the command line as administrator, the path is as follows: "C: Windows system32".
Windows command line commands must be entered in the interpreter window immediately after the ">" sign, at which point the cursor blinks.
To copy a command from a computer, and then paste the command into the command line, use the context menu of the right mouse button. Copy the command to the clipboard, paste the mouse cursor into the command window, click the right mouse button. Windows 10 supports copying and pasting using standard keyboard keys: “Ctrl” + “C” and “Ctrl” + “V”.
Some system applications start immediately after entering a command that consists of the name of the application, for example, if you run the calc command, the system program Calculator will start on the computer.
For other programs, you will need to enter the full path to the application executable. If there are spaces in the path to the file, the full path is enclosed in quotation marks, for example, the command to launch the Google Chrome browser looks like this:
After starting a command from the command line, the implementation of the command execution is not always externally noticeable, due to the fact that there are internal changes in the operating system.
Other parameters, keys for performing specific actions, are often added to the main command.
If you enter the wrong command, for example, the one entered with errors, or if the Windows operating system cannot run the command for any reason, a message will appear in the command line interface window.
Windows Command Line Commands
The user can independently learn the basic commands from the Command Line utility itself. To do this, just enter the command: "help".
The command line interface displays a list of basic commands.
To get information about the parameters of an individual command, you need to enter one of the following commands that are executed the same way (do not forget to put a space):
As a result, you will get information about all the parameters of this command.
Windows Command Prompt: List of Basic Commands
Check out the table that summarizes the commands used on the Windows command line. If I missed any important command, write about it in the comments to this article, I add the command to the table.
|appwiz.cpl||running a system tool to change or remove programs|
|arp||mapping and changing ARP tables of IP-to-physical conversion used by the address resolution protocol|
|assoc||display or change mappings by file name extensions|
|at||running programs at a specified time|
|attrib||display and change file attributes|
|bcdboot||tool for creating and restoring boot configuration data files|
|bcdedit||editing changes in the system bootstrap database|
|break||changing the processing mode of the key combination “Ctrl” + “C”|
|blastcln||worm cleaning utility|
|bootcfg||configure, retrieve, modify, or delete command-line options in the Boot.ini file in Windows XP|
|call||calling one batch file from another|
|cacls||viewing and editing changing file access control tables (ACLs)|
|calc||calculator application launch|
|cd||display name or change current folder|
|charmap||table of symbols|
|chcp||display or change the active code page|
|chdir||display or change the current folder|
|copy||copying one or more files|
|chkdsk||checking the disk for errors and displaying statistics|
|chkntfs||display or change disk check options at boot time|
|ciddaemon||file indexing service|
|cipher||file and folder encryption in NTFS|
|cleanmgr||Disk Cleanup utility|
|cmd||launching another windows command line interpreter|
|compmgmt.msc||opening computer management console|
|color||set foreground and background colors to default|
|comp||comparing the contents of two files or two sets of files|
|compact||viewing and changing file compression settings in NTFS partitions|
|computerdefaults||default application selection|
|control desktop||screen customization and personalization|
|control folder||folder properties in Explorer options|
|control keyboard||opening the keyboard properties window|
|control mouse||mouse properties|
|control printer||devices and printers|
|control schedtasks||Task Scheduler|
|control userpasswords2||user account management|
|convert||converting the FAT volume file system to NTFS (does not work on the current drive)|
|copy||copy files to another location|
|credwiz||backup and restore usernames and passwords|
|date||display or set the current date|
|debug||program debugging and editing tool|
|defrag||start disk defragmentation|
|del||delete one or more files|
|desk.cpl||screen resolution setting|
|devicepairingwizard||add new device|
|dfrgui||disk optimization (defragmentation)|
|dir||listing files and subfolders from a specified folder|
|diskmgmt.ms||opening the Disk Management snap-in|
|diskpart||display and configuration of disk partition properties|
|diskperf||enable or disable performance counter|
|doskey||command line editing, recalling Windows commands, creating macros|
|dxdiag||DirectX Diagnostic Tool|
|echo||displaying messages and switching the display mode of commands on the screen|
|endlocal||completion of local environment changes for a batch file|
|erase||delete one or more files (overwriting)|
|esentutl||Microsoft Windows Database Maintenance Utilities|
|eudcedit||personal character editor|
|eventcreate||create a record of a special event in the specified event log|
|expand||unpacking compressed files|
|fc||comparing files or sets of files, displaying the differences between them|
|find||search for a text string in one or several files|
|findstr||search text string in file|
|finger||user information for the specified system on which the Finger service is running|
|firewall.cpl||Windows Defender Firewall|
|for||running the specified command for each file in the set|
|fsquirt||Bluetooth file transfer|
|fsutil||show and configure file system properties|
|ftype||display or change file types when matching file names|
|ftp||FTP file sharing|
|goto||transferring control to the specified line in the batch file|
|getmac||display of MAC addresses of one or more network adapters|
|gpresult||Group Policy information for a computer or user|
|graftabl||display extended character set in Windows graphics mode|
|gpedit.msc||Local Group Policy Editor|
|gpupdate||updating settings for multiple group policies|
|hdwwiz||hardware installation wizard|
|icacls||display, change, backup, restore ACLs for files and directories|
|iexpress||creating a self-extracting archive|
|if||conditional processing in batch programs (files)|
|ipconfig||IP address information|
|label||create, modify, and delete volume labels for disks|
|lodctr||updating registry settings related to counter performance|
|logman||Managing Alerts and Performance Logs|
|lpksetup||install or remove Windows interface languages|
|lusrmgr.msc||local users and groups|
|magnify||Magnifier application launch|
|makecab||archiving files in a CAB archive|
|md||creating a directory (folder)|
|mdsched||random access memory checker|
|mkdir||create directory (folder)|
|mode||system device configuration|
|more||serial data output in one-screen parts|
|mountvol||create, view, and delete connection points|
|move||moving one or more files from one folder to another|
|mrt||Launch Malicious Software Removal Tool|
|msg||sending messages to the user|
|mspaint||launch of the paint editor|
|msra||Windows Remote Assistance|
|net||network resource management|
|netstat||display protocol statistics and current TCP / IP network connections|
|netplwiz||user account management|
|odbcconf||ODBC driver setup|
|openfiles||listing of open files and folders opened in the system|
|optionalfeatures||enable or disable windows components|
|osk||launch on-screen keyboard|
|path||output or set the path to search for executable files|
|pause||pause batch file execution, message output|
|popd||restore previous value of current folder saved by pushd command|
|prompt||change windows command line|
|pushd||saving the current directory and then changing the directory|
|ping||sending packets to the specified address|
|powercfg||system power management|
|print text file|
|qprocess||process information display|
|qwinsta||Display Remote Desktop Services Session Information|
|recover||recovery of saved data on a damaged disk|
|recdisc||create Windows recovery disk|
|reg||team for working with the registry|
|rem||putting a comment in a batch file or in a config.sys file|
|ren||renaming files and folders|
|rename||renaming files and folders|
|rstrui||restore Windows from system restore points|
|runas||to use applications on behalf of another user|
|rwinsta||resetting the equipment subsystems and session programs to the initial state|
|secpol.msc||local security policy|
|set||output, set, and delete Windows environment variables|
|setlocal||start of local environment changes in a batch file|
|sc||display and configuration of services (background processes)|
|sfc||checking the integrity of all protected system files and replacing the wrong ones|
|sigverif||file signature verification|
|shift||changing contents of replaceable parameters for batch file|
|start||launch the specified program or command in a separate window|
|schtasks||launching programs and executing commands on a PC on a schedule|
|sdbinst||compatibility database installer|
|shutdown||restart or shut down the computer|
|subst||mapping the drive name to the specified path|
|systeminfo||operating system configuration information|
|taskkill||forced termination of a process or application|
|tasklist||Show all tasks currently running, including services|
|tcmsetup||telephony client installation|
|time||view and change the current time|
|timedate.cpl||time and date setting|
|title||assignment of the title of the current window of the command line interpreter|
|tracert||trace route to the specified node|
|tree||graphical display of the structure of a given disk or folder|
|tscon||join a user session to a remote desktop session|
|tsdiscon||disconnect Remote Desktop Services session|
|tskill||termination of the process|
|type||text file output|
|typeperf||display performance information on screen or in a log|
|ver||Windows version information output|
|verifier||driver check manager|
|verify||setting the verification mode in Windows to correctly write files to disk|
|vol||display label and serial number of the volume for the disk|
|vssadmin||command-line tool for administering the volume shadow copy service|
|w32tm||show current settings for displaying time zone|
|winver||Windows version information on screen|
|wmic||WMI toolkit information in the interactive shell|
|write||WordPad text editor|
|wscui.cpl||safety and service center|
|wusa||standalone update installer|
|xcopy||copy files and folder tree|
Conclusions of the article
The command line in the Windows operating system allows the user to control the computer without using a graphical interface. To perform certain actions on a PC, you must enter special commands into the command line interpreter. This article has published a table with a list of the most requested commands for the Windows command line.
Основные команды командной строки
DIR — сокращение от Directory , эта CMD команда для новичка выводит список всех файлов и папок в определенном каталоге. А также их размер, расширение и свободное пространство, оставшееся на диске. The command can be changed using additional parameters, such as DIR / p (displays a list of pages), DIR / q (displays information about the site owner), DIR / w (displays a list in an extended format with a maximum number of files in one line), DIR / d (displays the list in an expanded format, divided by columns), DIR / n (displays a long list in one line), DIR / l (displays an unsorted list of directory names and file names in lower case), DIR / b (displays a list of files without additional information). DIR / s lists the files and directories of this directory, as well as all subdirectories. By entering DIR /? , you will see a list of all available options.
The CD or CHDIR (Change Directory) command is intended to change the directory. The team performs several operations. The CD takes you to the very top of the directory tree. CD .. moves you to the parent directory relative to the current one. CD directory_name moves you to this directory. Enter a CD to display the name of the current directory.
MD or MKDIR (Make Directory) allows you to create a directory (folder). To create a directory, use the following syntax: MD directory_name.
CLS clears the screen. This CMD command on Windows is used if the command line emulator is populated with a list of commands and their operations.
EDIT file-name allows you to modify the contents of a file.
The DEL command allows you to delete one or more files. Alternatively, you can use the ERASE command. Use the DEL filename syntax to delete a file.
If you want to delete all files with a specific extension, then enter DEL * .doc, and all files with the doc extension will be deleted from the current directory. DEL *. * Deletes all files from the current directory, so be careful with this command.
RD or RMDIR - you can use this command to delete a folder, but the folder should be empty. The syntax is pretty simple. Enter RD FolderName. If you want to delete a folder that is not empty, you can use RD / S folder_name. Be careful with this command, as it deletes the folder and all its contents without recovery.
RENAME, or REN renames a file or directory. The syntax for this computer control CMD command is: RENAME current-name new-name. For example, if you want to rename a file named iPhone.txt to iPad.txt, enter RENAME iPhone.txt iPad.txt.
MOVE allows you to move one or more files from one directory to another. For example, if you want to move the 1.txt file located in the current directory to a folder named Numericals inside the current directory, enter MOVE 1.txt Numericals.
If you tried to rename a directory (folder) using the RENAME command in the above way, then you know that this does not work. The MOVE team will help us with this, as it can also be used to rename directories. Enter MOVE current-name new-name, where the current name is the name of the directory in the current folder.
The COPY command allows you to copy one or more files from one place to another. The command allows you to combine files of the same type. Let's look at various examples of using the COPY command:
- COPY file-name folder-name will copy file file-name to an existing folder,
- COPY file-name new-file-name creates a copy of the file with a new name,
- COPY * .doc Word copies all files with the extension .doc to a folder named Word.
The CMD XCOPY main command is for files and directories, including subdirectories. The easiest way to use it is to copy all files from one drive to another. Syntax: XCOPY Source-drive: Destination-drive: / e, where the / e option allows you to copy all subdirectories, even if they are empty. Use / s to prevent copying empty directories. You can use the folder names of the source or destination drive to simply copy the entire contents of one folder to another.
The FORMAT command in CMD allows you to erase information from the hard drive or prepare it for copying data if you installed a new disk. The syntax for using the command is: FORMAT drive:. If you want to reformat a particular drive to a specific file system, you can do this with the command: FORMAT drive: / FS: file-system, where file-system can be: FAT, FAT32 or NTFS. After applying the command, all data from the disk will be erased without a trace.
FC - used to compare two files with each other. Suppose you have two files gadgets360_1.txt and gadgets360_2.txt. To compare them, you need to enter the following command: FC gadgets360_1.txt gadgets360_2.txt.
IPCONFIG displays detailed information about network settings: the IP address, and also reports the type of network connection of your computer (using Wi-Fi or Ethernet). Enter IPCONFIG / ALL to get an overview of all network settings, including which DNS servers you are using. Enter IPCONFIG / RENEW to get the new IP address from the DHCP server. This can help if you are having problems connecting to the internet.
CMD ping command - if you are not sure if the site you want to visit is available, enter PING followed by an IP address or domain name. For example, PING google.com. If Destination Net Unreachable appears on the screen, you may not have an internet connection. If Host is down or Request timeout messages appear, the site may not be available. If everything is ok, you should see something similar to this: 64 bytes from 188.8.131.52: icmp_seq = 0 ttl = 56 time = 118.355 ms.
The SHUTDOWN command may come in handy if the Shut Down button on the Start menu does not work due to malware. To shut down the computer (for Windows), enter Shutdown / S. To restart the computer - Shutdown / R.
CHKDSK - CMD command is used to check if your operating system can read the hard drive or any other media correctly. Command syntax: CHKDSK C: - replace C with the drive letter you want to check. Enter CHKDKS /? to see other options.
This publication is a translation of the article "CMD Commands Every Windows User Must Know", prepared by the friendly team of the project Internet technology.ru