You are currently viewing CMD Commands Cheat Sheet

CMD Commands Cheat Sheet

Basic Navigation:

BAT (Batchfile)
cd [directory_path]   # Change the current directory.
dir [directory_path]  # List directory contents.
mkdir [directory_name]  # Create a new directory.

File Operations:

BAT (Batchfile)
copy [source] [destination]  # Copy files from source to destination.
move [source] [destination]  # Move or rename files and directories.
del [file_name]  # Delete a file.

System Information:

BAT (Batchfile)
systeminfo  # Display detailed system information.
hostname  # Display the hostname of the computer.

Network Commands:

BAT (Batchfile)
ipconfig  # Display IP configuration information.
ping [host]  # Check network connectivity to a host.

User Account Management:

BAT (Batchfile)
net user [username] [password] /add  # Add a new user.
net localgroup [group_name] [username] /add  # Add a user to a local group.

Task Management:

BAT (Batchfile)
tasklist  # List running processes.
taskkill /F /IM [process_name]  # Terminate a process.

Miscellaneous:

BAT (Batchfile)
tasklist  # List running processes.
taskkill /F /IM [process_name]  # Terminate a process.

Advanced CMD Commands:

BAT (Batchfile)
sfc /scannow  # Scan and repair system files.
chkdsk [drive_letter]: /f  # Check and fix disk errors.
robocopy [source] [destination] /options  # Robust file copy.
wmic [option] [command]  # Windows Management Instrumentation.
powercfg /option  # Power configuration.
regedit  # Registry Editor.
netstat -an  # Display network statistics.
gpupdate /force  # Force an immediate update of Group Policy.
shutdown /s /t [time_in_seconds]  # Shutdown the system.

Keyboard Shortcuts:

BAT (Batchfile)
Ctrl + C  # Copy selected text.
Ctrl + V  # Paste copied text.
Ctrl + A  # Select all text.
Ctrl + Arrow Keys  # Navigate word by word.
F7  # Display command history.

Additional Tips:

BAT (Batchfile)
>  # Redirect output to a file.
Use quotes for paths with spaces.
Run CMD as an administrator for certain commands.
command_name /?  # Get help and additional options.

Troubleshooting and Maintenance:

BAT (Batchfile)
dism /online /cleanup-image /restorehealth  # Repair the Windows image.
netsh [command]  # Network Shell command.
taskmgr  # Open Task Manager.
perfmon  # Launch Performance Monitor.
gpedit.msc  # Open Group Policy Editor.
chkntfs [drive_letter]:  # Check the NTFS file system on the specified drive.

Batch Scripting:

BAT (Batchfile)
FOR /F "options" %variable IN ('command') DO command  # Loop command.
IF [condition] command  # Conditional statement.
GOTO label  # Jump to a specific label.

Remote Desktop Connection:

BAT (Batchfile)
mstsc  # Open Remote Desktop Connection.
shutdown /m \\computername /s /t [time_in_seconds]  # Remote shutdown.

System Backup and Restore:

BAT (Batchfile)
wbadmin start backup -backupTarget:[target] -include:[items_to_include]  # Start a backup.
rstrui.exe  # Open System Restore.

Table Of Commands

CategoryCommandDescription
Basic Navigationcd [directory_path]Change the current directory.
dir [directory_path]List directory contents.
mkdir [directory_name]Create a new directory.
File Operationscopy [source] [destination]Copy files from source to destination.
move [source] [destination]Move or rename files and directories.
del [file_name]Delete a file.
System InformationsysteminfoDisplay detailed system information.
hostnameDisplay the hostname of the computer.
Network CommandsipconfigDisplay IP configuration information.
ping [host]Check network connectivity to a host.
User Account Managementnet user [username] [password] /addAdd a new user.
net localgroup [group_name] [username] /addAdd a user to a local group.
Task ManagementtasklistList running processes.
taskkill /F /IM [process_name]Terminate a process.
Miscellaneousecho [text]Display text on the screen.
clsClear the screen.
Advanced CMD Commandssfc /scannowScan and repair system files.
chkdsk [drive_letter]: /fCheck and fix disk errors.
robocopy [source] [destination] /optionsRobust file copy.
wmic [option] [command]Windows Management Instrumentation.
powercfg /optionPower configuration.
regeditRegistry Editor.
netstat -anDisplay network statistics.
gpupdate /forceForce an immediate update of Group Policy.
shutdown /s /t [time_in_seconds]Shutdown the system.
Keyboard ShortcutsCtrl + CCopy selected text.
Ctrl + VPaste copied text.
Ctrl + ASelect all text.
Ctrl + Arrow KeysNavigate word by word.
F7Display command history.
Additional Tips>Redirect output to a file.
Use quotes for paths with spaces.
Run CMD as an administrator for certain commands.
command_name /?Get help and additional options.
Troubleshooting and Maintenancedism /online /cleanup-image /restorehealthRepair the Windows image.
netsh [command]Network Shell command.
taskmgrOpen Task Manager.
perfmonLaunch Performance Monitor.
gpedit.mscOpen Group Policy Editor.
chkntfs [drive_letter]:Check the NTFS file system on the specified drive.
Batch ScriptingFOR /F "options" %variable IN ('command') DO commandLoop command.
IF [condition] commandConditional statement.
GOTO labelJump to a specific label.
Remote Desktop ConnectionmstscOpen Remote Desktop Connection.
shutdown /m \\computername /s /t [time_in_seconds]Remote shutdown.
System Backup and Restorewbadmin start backup -backupTarget:[target] -include:[items_to_include]Start a backup.
rstrui.exeOpen System Restore.
cmd commands cheat sheet

Leave a Reply