How to use Command Prompt commands? This post from MiniTool Partition Wizard introduces 14 basic CMD commands and gives you some examples. You can refer to them to learn some CMD lines.
In nearly every OS, there is a terminal allowing you to execute various commands. In Windows, this terminal is called Command Prompt, whose software is cmd.exe. Command Prompt is a command-line interpreter, which provides access to over 280 commands. These commands are used to do certain operating system tasks without a GUI.
In Windows, there is another terminal called PowerShell. Click PowerShell vs CMD to know more.
If you want to get the Windows Command Prompt cheat sheet, you can click this Microsoft page, which offers a full Command Prompt commands list arranged by the A-Z index. In this post, I will introduce 14 basic CMD commands.
How to Open Command Prompt (CMD) in Windows 11? (7 Ways)
#1. DiskPart
DiskPart is also a command line tool. You can open it from the CMD window. This tool can execute many commands and they are all related to disk, partition, dynamic disk, or dynamic volume.
DiskPart can create/format/delete/extend/shrink/active partitions, assign driver letters, convert a partition from FAT32 to NTFS without data loss, convert a disk between MBR and GPT, change partition ID, etc.
Click Microsoft’s DiskPart page to get the full list of DiskPart commands and then click this post to know how to use DiskPart in detail.
#2. CHKDSK
This tool includes many parameters. It can scan and fix disk errors and can even locate bad sectors and recover readable information. Click this post to know how to use this tool.
#3. SFC /Scannow
This command scans and verifies the integrity of all protected system files and replaces incorrect versions with correct versions. Click this post to know how to use this command in detail.
#4. MBR2GPT
This tool can convert a disk from MBR to GPT without data loss. Click this post to know how to use it in detail.
#5. CD (Change Directory)
If you want to find a file, you may use this command. It allows users to open a folder. For example, if you want to find a file under E:MiniTool, the command should be:
- E:
- cd MiniTool
Then, you can use the command “dir” to list all files under the E:MiniTool folder.
#6. Mkdir
This command is used when subdirectories are to be created within the directories. The syntax is as follows: mkdir [<drive>:]<path>.
#7. REN
This command is used to rename a file. The syntax is as follows: ren [<drive>:][<path>]<filename1> <filename2>.
#8. FC (File Compare)
This command can compare files that have been changed over time. The syntax is as follows: FC [<drive1>:][<path1>]<filename1> [<drive2>:][<path2>]<filename2>. For example, FC File 1.txt File 2.txt.
In addition, some parameters can help users compare them in a better way. For example:
- The parameter /a helps to concise the output when ASCII comparison is done. It shows the first and the last line in the list of differences.
- The parameter /c ignores the case-sensitive aspect of letters.
- The parameter /w disregards the white space, if any, at the beginning and end of the line.
#9. Attrib
This command allows users to change the attributes of a file. The syntax is as follows: Attrib [{+|-}r] [{+|-}a] [{+|-}s] [{+|-}h] [{+|-}i] [<drive>:][<path>][<filename>] [/s [/d] [/l]]. There are many parameters. You need to pick one accordingly.
#10. Powercfg
This command gives a report of the power settings of the computer. The syntax is as follows: powercfg /option [arguments] [/?]. Type the command powercfg /? to know how to use it. For example, the command powercfg list will list all the power sources.
#11. Systeminfo
This command helps to get system-related information like a network card, Windows OS, or details of the processor. The syntax is as follows: systeminfo [/s <computer> [/u <domain><username> [/p <password>]]] [/fo {TABLE | LIST | CSV}] [/nh]. But in most case, we just execute systeminfo directly.
#12. Ipconfig
In most cases, we just execute the command ipconfig directly. It will return detailed network information like IP address, Subnet Mask, Default Gateway IP, and current domain of the network.
#13. Ping
This command can help to check if the computer is able to access and connect to another computer or another network. Click this post to know how to use it in detail.
#14. NSLOOKUP
This tool is used to query the Domain Name System (DNS) to obtain the mapping between the domain name and the IP address, or other DNS records. Click this post to know how to use it in detail.
Bottom Line
How to use Command Prompt commands? This post gives you some examples. You can refer to them. In addition, MiniTool Partition Wizard can help you clone the system, manage disks better, and recover data. If you have this need, you can download it from the official website.