Windows usefull command prompt commands for Windows users! From basic file management to advanced system configurations, explore essential tools to streamline your computer tasks. This user-friendly guide provides practical insights into navigating directories, managing files, and troubleshooting issues efficiently, ensuring a smoother computing experience.
command prompt cheat sheet
File and Folder Management
Command | Description | Example Usage |
---|---|---|
CD | Change Directory | CD C:\Users\Username |
DIR | Directory Listing | DIR /A /W |
MD or MAKEDIR | Make Directory | MD NewFolder |
RD or RMDIR | Remove Directory | RD OldFolder |
DEL or ERASE | Delete | DEL FileName.txt |
COPY | Copy | COPY File1.txt DestinationFolder |
MOVE | Move | MOVE File1.txt DestinationFolder |
REN or RENAME | Rename | REN OldName.txt NewName.txt |
System Information and Configuration
Command | Description | Example Usage |
---|---|---|
IPCONFIG | IP Configuration | IPCONFIG /ALL |
SYSTEMINFO | System Information | SYSTEMINFO |
TASKLIST | Task List | TASKLIST |
TASKKILL | Task Kill | TASKKILL /F /IM process.exe |
SHUTDOWN | Shutdown or Reboot Computer | SHUTDOWN /S /T 0 |
Disk and Drive Management
Command | Description | Example Usage |
---|---|---|
CHKDSK | Check Disk | CHKDSK C: |
DEFRAG | Disk Defragmentation | DEFRAG C: |
DISKPART | Disk Partition Management | DISKPART |
FORMAT | Format Disk | FORMAT D: |
Network
Command | Description | Example Usage |
---|---|---|
PING | Ping | PING google.com |
TRACERT | Trace Route | TRACERT google.com |
NETSTAT | Network Statistics | NETSTAT -a |
Additional Utilities
Command | Description | Example Usage |
---|---|---|
CLS | Clear Screen | CLS |
HELP | Command Prompt Help | HELP CD |
EXIT | Exits the Command Line | EXIT |
Explain All CMD Commands In Details
File and Folder Management
1) CD (Change Directory)
To change the current working directory in Command Prompt, you can use the cd
command.
Here’s the basic syntax.
cd directory_path
- Replace
directory_path
with the path of the directory you want to navigate to. - For example,
cd C:\Users\Username
will change the current directory to “C:\Users\Username“.
2) DIR (Directory Listing)
To list the files and subdirectories in the current directory, you can use the dir
command.
Here’s how it works.
dir
- Simply typing
dir
will display the contents of the current directory. - You can also add options like
/A
to display hidden files or/W
for a wide list format.
3) MD or MAKDIR (Make Directory)
To create a new directory, you can use the mkdir
or md
command.
Here’s the basic syntax.
mkdir new_directory_path
- Replace
new_directory_path
with the path of the new directory you want to create. - For example,
mkdir NewFolder
will create a new directory named “NewFolder“.
4) RD or RMDIR (Remove Directory)
To delete a directory, including all of its contents, you can use the rmdir
or rd
command.
Here’s how it’s done.
rmdir /s /q directory_path
- The
/s
option is used to remove the directory and all of its contents, including subdirectories and files. - The
/q
option is used for quiet mode, meaning it won’t ask for confirmation before deleting. - Replace
directory_path
with the actual path of the directory you want to delete. - For example,
rmdir /s /q C:\Users\Username\Example
will delete the directory “Example” located in “C:\Users\Username“.
System Information and Configuration
1) IPCONFIG (IP Configuration)
To display information about network interfaces, you can use the ipconfig
command.
Here’s how it works.
ipconfig
- Typing
ipconfig
will display information such as IP address, subnet mask, and default gateway for all network adapters.
2) SYSTEMINFO (System Information)
To view detailed configuration information about your computer, you can use the systeminfo
command.
Here’s the basic syntax.
systeminfo
- Typing
systeminfo
will display information about the operating system, hardware resources, and installed software.
3) TASKLIST (Task List)
To list the tasks being performed by the system, you can use the tasklist
command.
Here’s how it’s done.
tasklist
- Simply typing
tasklist
will display a list of all running processes along with their Process ID (PID) and memory usage.
4) TASKKILL (Task Kill)
To stop or halt a task or process, you can use the taskkill
command.
Here’s how it works.
taskkill /im process_name /f
- Replace “process_name” with the specific name of the process you want to terminate.
- The
/f
option forcefully terminates the process. - For example,
taskkill /im notepad.exe /f
will forcefully terminate the Notepad process.
5) SHUTDOWN (Shutdown or Reboot Computer)
To shut down or reboot your computer from Command Prompt, you can use the shutdown
command.
Here’s the basic syntax.
shutdown /s /t time_in_seconds
- The
/s
option is used to shut down the computer. - The
/t
option specifies the time delay before shutdown in seconds. - For example,
shutdown /s /t 60
will shut down the computer after a delay of 60 seconds.
Disk and Drive Management:
1) CHKDSK (Check Disk)
To check a disk for errors and display a status report, you can use the chkdsk
command. Here’s how it’s done:
chkdsk drive_letter:
- Replace
drive_letter
with the letter of the drive you want to check (e.g., C:, D:). - For example,
chkdsk C:
will check the C: drive for errors and display the status report.
2) DEFRAG (Disk Defragmentation)
To defragment a disk and optimize its performance, you can use the defrag
command.
Here’s the basic syntax.
defrag drive_letter:
- Replace
drive_letter
with the letter of the drive you want to defragment (e.g., C:, D:). - For example,
defrag C:
will defragment the C: drive.
3) DISKPART (Disk Partition Management)
To manage disks, partitions, and volumes, you can use the diskpart
command.
Here’s how it works.
diskpart
- Typing
diskpart
will launch the DiskPart command-line utility, where you can perform various disk management tasks.
4) FORMAT (Format Disk)
To format a disk for use with Windows, you can use the format
command.
Here’s the basic syntax
format drive_letter: /FS:filesystem_type
- Replace
drive_letter
with the letter of the drive you want to format (e.g., C:, D:). - Replace
filesystem_type
with the desired file system type (e.g., NTFS, FAT32). - For example,
format D: /FS:NTFS
will format the D: drive with the NTFS file system.
Network
1) PING (Ping)
You can utilize the ping command to assess the accessibility of a host on an Internet Protocol (IP) network and gauge the round-trip time for messages transmitted from the source host to a target computer.
Here’s a breakdown of its functionality.
ping hostname_or_IP_address
- Replace
hostname_or_IP_address
with the name or IP address of the destination host. - For example,
ping google.com
will send ICMP echo request packets to the Google server to check for connectivity.
2) TRACERT (Trace Route)
To determine the route taken by packets across an IP network, you can use the tracert
command.
Here’s the basic syntax.
tracert hostname_or_IP_address
- Replace
hostname_or_IP_address
with the name or IP address of the destination host. - For example,
tracert google.com
will display the path taken by packets to reach the Google server.
3) NETSTAT (Network Statistics)
To display active network connections, routing tables, and network interface statistics, you can use the netstat
command.
Here’s how it works.
netstat [-a] [-n] [-o]
- The
-a
option displays all connections and listening ports. - The
-n
option displays addresses and port numbers in numerical form. - The
-o
option displays the owning process ID associated with each connection. - For example,
netstat -ano
will display all active network connections along with their process IDs.
Additional Utilities
1) CLS (Clear Screen)
To clear the contents of the Command Prompt window, you can use the cls
command.
Here’s the basic syntax.
cls
- Typing
cls
will clear the screen, making it easier to read the output of subsequent commands.
2) HELP (Command Prompt Help)
To get information about Command Prompt commands and their usage, you can use the help
command.
Here’s how it works
help [command_name]
- Replace
[command_name]
with the name of the command you want help with. - For example,
help cd
will display help information for thecd
command.
3) EXIT (Exit Command Prompt)
To exit the Command Prompt and return to the Windows environment, you can use the exit
command. Here’s how it’s done:
exit
- Typing
exit
will close the Command Prompt window.