Command Prompt Commands: All cmd Commands Code in Windows

We use Command prompt commands to make our lives easy. With the help of the Windows command prompt, you can execute text-based order on the Windows screen. Those cmd commands make your products faster. I will provide an extensive list of Command prompt codes of Microsoft Windows.

What is a Command Prompt?

Windows command prompt is the default command-line interpreter of Windows operating systems. The official name is Windows Command Processor. However, you may know it as a command shell or cmd prompt. Users use it to execute entered text-based commands. It emulates the black screen input field in a text-based user interface to make you faster and more productive. Cmd commands code allows you to perform all the functions as a graphical user interface.

Some Basic Command Prompt Commands

Yod does not need to be an expert on computers. Just memorize the following commands. It will give you a more extraordinary dividend. Here are some common cmd of Win Command prompt.

1. Shutdown cmd

Shutdown cmdThe most exciting command and prompt code is shutdown. You can customize the shutdown in various ways. Cmd allows you to create a schedule shutdown command within a second. However, there are many necessities of shutdown/restart-related commands. Here, I will show some examples of cmd. 

First of all, the recommended cmd is shutdown /? It will show all the shutdown-related commands of your computer. However, here are some cmd for you:

Shutdown: type shutdown /s

Schedule Shutdown: Type shutdown -s -t 3600

Restart: type shutdown /r

Logout: type shutdown /l

2. Check the IP address from CMD ipconfig

Check IP address from CMD ipconfigIpconfig is a console application program to display all the current TCP/IP network configurations. It also refreshes the DHCP and DNS. If an IP is assigned to your machine, then cmd ipconfig helps see the IPs. In the cmd prompt, if you command ipconfig, you will see the default gateway, subnet mask, and assigned IP. 

3. Windows 10 pro activator cmd

If your PC does not have a genuine Windows key, you may search for the original one. Here, the Windows 10 activator cmd will help to activate your product ID. To activate it, you can follow the instructions:

Open command prompt as Administrator. Run the Command: slmgr /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43

If this code is not accepted, you can take any of the following images: Windows 10 pro activator cmd

4. Get Windows Install Date

You may need to calculate the Windows license renewal date when you are a responsible business owner. Some simple command and prompt codes will help you show the Windows installation date for better calculation. Here the Command is:

Type: Systeminfo

Get Windows Install DateThe screen will show the time zone, total physical memory, virtual memory, network card, and Hyper-V Requirements.

5. Office Activator cmd

In Office 2010 and Office 13, you can activate your Microsoft Office key. Here, again, you have to open your cmd platform as Administrator. If you use any 32-bit or 64-bit PP but a 32-bit office package, you must command cd \Program Files\Microsoft Office\Office15. The 32-bit Office on a 64-bit Windows has to command cd \Program Files (x86)\Microsoft Office\Office15. When you press Enter, it will connect to the KMS server on cscript ospp.vbs /

6. Diskpart Windows 10

Diskpart Windows 10 Command Prompt CommandsYou can use the diskpart Command for Partition, Remove partitions, Remove formatting, and many other issues. Here are all the cmd diskpart for your study:

Serial Cmd Diskpart Action
1. ACTIVE To mark the selected partition as active
2. ASSIGN  Assign a drive letter
3. ATTRIBUTES Manipulate volume
4. ATTACH virtual disk file attachment
5. AUTOMOUNT automatic mounting (To turn on and off)
6. BREAK To break a mirror set
7. CLEAN Clear all information
8. COMPACT Reduce the physical size.
9. CONVERT   Convert different disk formats.
10. CREATE  volume, partition, and virtual disk creation
11. DELETE To erase any object
12. DETAIL Details Information
13. DETACH Virtual disk file detachment
14. EXIT  Exit from the DiskPart option

7. Net user administrator

A net user is a command-line tool for Windows users. It applies to Windows 7, 8, 10, 11, and Vista. You can view the user account status using the net administrator command. Moreover, you can add, delete, and edit the users of Windows with this Command. Here is the administrator syntax of the net user:

net user [<Enter_UserName> {<Provide_Password> | *} [<Options>]] [/domain]

net user [<Enter_UserName> {<Provide_Password> | *} /add [<Options>] [/domain]]

net user [<Enter_UserName> [/delete] [/domain]]

8. Clear Command Prompt

When you are a beginner, you may face many funny problems. Cleaning the Command prompt screen is one of them. You can clock on the X icon and reopen the cmd admin screen again. The easy technique of cmd clear Command will erase all of your practice. Type cls and press Enter. You will see all data is deleted. 

9. List disk cmd

In the Windows operating system, wmic is an excellent command to see Windows Management Instrumentation. The command and prompt codes will show all the available drives in the directory. Type wmic and press Enter. You will see the Command like this: List disk cmd

10. Cmd find

You can find cmd to search both text and folder in Windows Command Prompt. It is a filter command to read from the input, transform, and output through a file, screen, and printer. It searches for the string of the text inside any file. The Command will display lines of text which have a specific string. 


find [/v] [/c] [/n] [/i] [/off[line]] <“string”> [[<driveOfFile>:][<pathOfFile>]<nameOfFile>[…]]

11. cmd chkdsk

You can check the file system and metadata for your PC’s logical and physical errors. You can check it by both DEFRAG and CHKDSK. When using an SSD, it is wise to use DEFRAG because SSD differs from HDD. So, you can run chkdsk after several months.

12. Copy file cmd

When you are aware of a copy unattended task while copying, you can use copy file cmd in the command prompt. The method is different from the traditional copying method. It allows you to save time. You have to decide simultaneously regarding the copying file and destination location. 

Method of copy:

  1. Go to the directory where the file is located. Suppose the file name is fossguru.doc. Now type the command copy c:\fossguru. doc d
  2. The file will copy and paste to the D directory.

cmd xcopy

You can use the xcopy Command to transfer one file to another file. For example, type xcopy c:\fossguru. doc d Guru, then the contents of fossguru will be transferred to Guru in the D folder. If the file name is more than one word, use “ ” for the Command. Here, the Command will be xcopy c:\fossguru. doc “d Foss Guru.” 

13. Command-line Windows 10

We use command line Windows 10 to provide text-based user input in a graphical user interface-based operating system. You can perform administrative activities with a command line. Moreover, the command line in the command prompt helps to troubleshoot Windows problems instantly.

14. cmd hacking commands

Windows command line commands are used for many unique purposes. Therefore, hacking is one of them. There are a lot of commands to connect to another IP. Ping, nslookup, tracert, and arp are common commands for that purpose.

15. Disk cleanup cmd

You have to be an expert in managing your drive. You can clean up your disk with a simple command. Type c:\windows\SYSTEM32\cleanmgr.exe /dDrive. Here, the drive is the name of your desired drive.

16. Control panel command line

Control panel command lineSometimes, you may face computer startup problems. In Windows safe mode, you can solve the problem. To solve it:

  1. Open the command prompt.
  2. Scan the problems by the sfc/scannow command.
  3. Hit Enter. You will find problems, if any.

Suppose the problem relates to bootrec, boot sector, or boot configuration in the Windows Recovery Environment. Execute the bootrec commands. It will scan the Windows drives before installation.

17. taskmanager cmd

taskmanager cmd Windows 10 Command Prompt CommandsWhen your computer is busy with many programs, you can reduce the load using a task manager. You can easily open the task manager from the command prompt dialogue box. Type taskmgr on the command prompt and press enter. Suddenly, you will see the task manager pop up on your PC.

18. TaskKill: Kill process from the command line (CMD)

Once you love the command prompt, you will search all the commands through cmd. You can close any of the applications with the command line. To close any operation type taskkill /IM executablename. For example, taskkill /IM videoEditor.exe. Suppose you need to force stop type taskkill /F /IM videoEditor.exe. In both cases, you will get the option to save your data.

19. Get The Tasklist

There are a lot of processes always running out of your eyesight. Sometimes, you need to see the ongoing tasks of your computer. Moreover, there may be spy apps on your PC. To see all the running applications, type tasklist on your command prompt. When you think to reduce the memory load of your PC, you have to see the memory used over a particular range. So, type tasklist /fi “memusage gt memorysize”. Replace the memorysize with your desired value. 

20. netsh wlan show interfaces

netsh wlan show interfacesThe netsh wlan show profile command shows all the networks you have connected with your Windows computer in your life. To execute your Command, you must return your base cmd platform/interface with the exit command. Now type netsh wlan show profile and press Enter.

21. WiFi Password Cmd Code

To view the saved WiFi passwords using the Command Prompt in Windows, follow these steps:

  1. Open Command Prompt as Administrator: Press Win + X and select “Command Prompt (Admin)” or “Windows Terminal (Admin)” from the menu.
  2. Run Command with Administrative Privilege: In the Command Prompt window, type the following command and press Enter: 

netsh wlan show profiles

This Command will display a list of all the WiFi networks your computer has connected to.

  1. Retrieve Password: To retrieve the password for a specific network, use the following command, replacing “NETWORK_NAME” with the name of the network you want to retrieve the password for:

netsh wlan show profile name=”NETWORK_NAME” key=clear

Look for the “Key content” field under “Security settings” in the output. The value next to “Key content” is the WiFi password for the network.

22. Device manager command line

In your busy schedule, you may need to manage your device manager. A simple command devmgmt.msc will take you to the Windows device manager window. However, you can execute the same Command from the run box.

23. Check if Windows 32 or 64-bit

When you download any software from the internet, you will think your PC is Windows 32 or 64-bit. You can see it from Windows properties. But the problem is, it will show you a lot of information that is not required. So, the following Comcommandll shows you Windows 32 or 64-bit.

Type: wmic os get OSArchitecture

24. Reboot the Windows computer from the command line (CMD)

With the help of a Windows built-in command prompt, you can reboot your PC. It is applied to all the versions, including the server edition. Now type shutdown /r and press enter. Moreover, you can set a scheduled time for a reboot. The Command is shutdown /r /t timeout_in_seconds. However, you can cancel the Command by shutdown /a.

25. Ping Windows Command prompt command

Ping is a calm cmd command to see your PC’s internet connection. It transmits data to your specified IP address from a network and shows how long it took to send that data and get a response. However, the primary purpose of ping is to see that it can connect with other computers through the network.

Ping windows command prompt command

Image: Ping in command prompt commands Windows 10

25. All Other Cmd Commands List With Example

In your day-to-day life, you may face difficulty exercising C prompt commands. Here are the best 50 command prompt lists to increase your efficiency. All other cmd codes at a glance for your better practice:

Serial Command Execution
Basic cmd commands list
1. cmd start command prompt
2. cmd cd command-line shell for changing the current working directory
3. Call execute a batch file from within another batch file.
4. color Specifies the color attribute of the console output
5. date show/set date
6. echo To display the command prompt, type echo on. To stop ty, pe echo off
7. hostname To show the hostname.
8. pause You can use pause at the end of the script. It will allow the user to read some output text.
9. Runas To “Run as different user.” 
10. sort To sort the list of lines that have a specified text.
11. time To display/edit the system time.
12. Timeout To wait for the command processing for some time and then continue.
13. title To change the title for the graphical terminal emulator window
14. ver It shows the version of your OS.
15. w32tm You can configure Windows Time service settings. Moreover, it helps to diagnose computer time problems.
cmd network commands/ Network Related Commands
16. FTP File Transfer Protocol (FTP) allows you to transfer files to and from a computer running a FTP server service.
17. type This Command lists all Registry keys in HKEthe Y CLASSES ROOT.
18. getmac It is the easiest way to get the mac address of your computer.
19. netstat It generates displays to show protocol statistics and network status.
20. nslookup This queries internet domain name servers in interactive and non-interactive modes.
21. pathping It locates spots with network latency, tests the connection to a specific IP address, and network loss.
22.  route It allows manual entries into the network routing tables.
23. telnet It helps to establish a Telnet connection
24. tftp This command transfers files to a TFTP server
25. tracert display the consumed time for a packet of data to transmit between a local PC and a destination IP address or domain
Windows  10 cmd commands list with example
26. attrib Change a file`s read/write attribute or set the archive attribute. 
27. comp You can use it to make comparisons of multiple computer files. Moreover, it shows the differences between different files.
28. diskcomp It works only with floppy disks and not for hard disk
29. erase / del it will delete every file (*. *) from every folder (/s)
30. expand It takes a compressed Windows file like .zip and expands it to its original form.
31. fc  The FC (file compare) command compares two files.
32. rename It renames the file in cmdthe  prompt.
33. Replace You can use it to replace files.
34. rmdir / rd remove empty directories in MS-DOS.
35. tree It displays directory paths and files in each subdirectory
36. type It displays the contents of a text file.
Media Windows cmd commands list with example
37. chkntfs This cmd displays or modifies automatic disk checking when starting your PC.
38. defrag defrag a drive in Windows 10.
39. driverquery Generate a list of Drivers
40. format It is used to format a specified partition. You can format a hard drive (internal or external) or flash drive to a specified file system.
41. label You can use it to view and change the label of a PC’s drives.
42. mode sets the mode of operation for communications
42. vol It shows the volume label and volume serial number of a logical drive. An example can be a hard disk partition.
43. verify Verifies that data written to drive
44. mountvol It assigns or deletes drive mount points.
Miscellaneous useful cmd commands list with example
45. for For loop
46. gpresult It displays group policies
47. gpupdate refreshes a computer’s local Group Policy and updates group policies.
48. perfmon To get to the Performance Monitor, you can use this Command.
49. reg To open the Windows registry in the command prompt, add, view, export, and import registry entries.
50. Exit To exit from the current screen or the command prompt.

27. Widely used System cmd Commands / Basic cmd Commands

Here are some wildly used system cmd commands. The user needs to open the command prompt in Administrative Privilege.

Serial Command Action
1 systeminfo View basic system information
2 ipconfig /all View network configuration
3 cd [directory_path] Change current directory
4 dir List files and folders in the current directory
5 mkdir [directory_name] Create a new directory
6 copy [source_file] [destination] Copy a file
7 move [source_file] [destination] Move a file
8 del [file_name] Delete a file
9 rmdir [directory_name] /s Delete a directory
10 tasklist List running processes
11 taskkill /pid [process_id] End a task by processing the ID
12 taskkill /im [process_name] End a task by process name
13 net user [username] [password] /add Add a user account
14 net user [username] /delete Delete a user account
15 net user [username] [new_password] Change a user’s password
16 ipconfig /release Release IP address
17 shutdown /s /f /t 0 Shut down the system
18 shutdown /r /f /t 0 Restart the system
19 chkdsk [drive_letter]: /f Check and repair disk for errors
20 format [drive_letter]: Format a drive

28. cmd.exe Commands

The cmd.exe commands are the executable file for the Command Prompt in Windows. It provides a command-line interface to interact with the operating system and perform various tasks using text-based commands. It allows users to enter commands to perform tasks such as navigating the file system, running programs, configuring system settings, managing files and directories, and more.

29. cmd running man code for fun

One of the exciting games in cmd codes for fun is the cmd running man code game. You can show the game to your baby. To run the game, you must open C Prompt in administrative mode. Now, type curl and press enter. You will see a man running like the image.

One of the exciting games in cmd codes for fun is the cmd running man code game.

Final Thought

If you are a graphical user interface user, you must use the Windows command prompt. It will save you time and make you more productive. I recommend that slow-speed computer users follow the dos commands list. It will increase their productivity.

Hawlader's passion for technology has driven him to be an avid writer for over 16 years. His vast knowledge of the Windows and Android operating systems is a testament to his proficiency in the field. In addition to his expertise in open source software, he also possesses an extensive understanding of the open-source platform, making him a valuable resource for technology enthusiasts. His contributions to FossGuru writers with research-based articles have helped readers to stay up-to-date with the latest trends in the tech industry. Furthermore, Hawlader's curiosity for scientific breakthroughs has led him to be a keen reader of science blogs, keeping him informed about the latest developments in the field.

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles