DEV Community

Cover image for Important CMD Commands
MarudhuPandiyan
MarudhuPandiyan

Posted on • Updated on

Important CMD Commands

Essential CMD Commands for Developers

This guide equips you with a valuable set of Command Prompt (CMD) commands that streamline your development workflow in Windows.

System Information:

Command: systeminfo
Description: Provides comprehensive details about your computer's configuration and operating system.

Date & Time Management:

date: Displays or sets the system date.
Use date /t to view the current date without inputting a new one.
time: Displays or sets the system time.
Use time /t to view the current time without inputting a new one.
Navigating Directories:

Drive Change Shortcuts:
c:: Switches to the C drive.
d:: Switches to the D drive.
Similarly for other drive letters (e.g., e:, f:)
dir: Lists the contents of the current directory.
Command Screen Management:

cls: Clears the command prompt screen for a fresh start.
Creating and Removing Directories:

mkdir [directory name]: Creates a new directory with the specified name.
rmdir [directory name]: Removes the specified directory. Important: The directory must be empty for successful removal.
Working with Files:

echo >> [file.name]: Appends text to an existing file or creates a new file with the specified content.
del [file name]: Deletes the specified file.
erase [file name]: Another option for file deletion.
tree: Displays a hierarchical representation of the directory structure, providing a visual map of your folders.
Managing Processes:

tasklist: Lists all currently running processes on your system.
taskkill /PID [pid_number]: Terminates a specific process by its Process ID (PID).
Device Drivers:

driverquery: Lists all installed device drivers and their properties.
driverquery -v: Provides detailed information about each installed device driver.

Renaming Files:

rename [file name] [new file name]: Renames the specified file.
ren [file name] [new file name]: Another way to achieve file renaming.
Creating Empty Files:

type nul > [file name]: Creates a new empty file with the specified name.

Additional Useful Commands:

ipconfig: Displays your current network configuration.
ping: Checks for network connectivity to a specific host.
sfc (System File Checker): Scans and repairs corrupted system files.
chkdsk: Checks a disk for errors and provides a report.
hostname: Displays the name assigned to your computer.
assoc: Displays or modifies file extension associations.
expand: Expands compressed files.
openfiles: Lists or disconnects opened files and folders (requires administrator privileges).
robocopy: A powerful file copying tool for advanced file management tasks.
*Further Exploration:
*

Consider exploring these additional commands for enhanced functionality:

python (if Python is installed): Executes Python scripts.
git (if Git is installed): Executes Git commands for version control.
npm (if Node.js is installed): Manages Node.js packages.
echo: Displays messages or controls command echoing behavior.
set /A: **Performs arithmetic operations within the command prompt.
**timeout:
Pauses the command processor for a specified duration.
choice: Prompts the user to select from a list of options.
prompt: Customizes the command prompt appearance.
title: Sets the window title for the Command Prompt.
color: Modifies the text and background colors of the Command Prompt window.
Remember, these commands are just the tip of the iceberg. The depth and power of CMD are vast, so keep exploring and learning!

Youtube Link: CMD COMMAND PROMPT

Top comments (0)