DEV Community

Cover image for Windows Commands Cheat Sheet :)
Madhav Ganesan
Madhav Ganesan

Posted on • Updated on • Originally published at madhavganesan.hashnode.dev

Windows Commands Cheat Sheet :)

Displays all current TCP/IP network

ipconfig/all
Enter fullscreen mode Exit fullscreen mode

Display system information

systeminfo
Enter fullscreen mode Exit fullscreen mode

Map IP addresses to MAC address

(Address Resolution Protocol)

arp -a
Enter fullscreen mode Exit fullscreen mode

Display all files and folders

dir
dir /a --displays all along with hidden folders
Enter fullscreen mode Exit fullscreen mode

Display all TCP connections

netstat -ano | findstr :<port>
Enter fullscreen mode Exit fullscreen mode

Display active processes using PID

tasklist /FI "PID eq <no>"
Enter fullscreen mode Exit fullscreen mode

Terminate particular process by PID

taskkill /PID <no> /F
Enter fullscreen mode Exit fullscreen mode

Check the connectivity

ping <hostname or IP address>
Enter fullscreen mode Exit fullscreen mode

Trace the route

tracert <hostname or IP address>
Enter fullscreen mode Exit fullscreen mode

DNS Lookup

nslookup <hostname>
Enter fullscreen mode Exit fullscreen mode

Check drive

Checks the file system and file system metadata of a volume for logical and physical errors.

chkdsk <drive>:
Enter fullscreen mode Exit fullscreen mode

Scan all files

Scans all protected system files and replaces corrupted files with a cached copy.

sfc /scannow
Enter fullscreen mode Exit fullscreen mode

Disk partitioning

diskpart
Enter fullscreen mode Exit fullscreen mode

Change Directory

cd <directory_path>
Enter fullscreen mode Exit fullscreen mode

Change current drive.

<drive_letter>:
Enter fullscreen mode Exit fullscreen mode

Boot Configuration

Views or makes changes to the Boot Configuration Data (BCD) store.

bcdedit
Enter fullscreen mode Exit fullscreen mode

Set an environment variable temporarily

Displays, sets, or removes environment variables in the current command prompt session.

set
set <variable>=<value>
set <variable>=
Enter fullscreen mode Exit fullscreen mode

Set an environment variable permanently

setx <variable> <value>
Enter fullscreen mode Exit fullscreen mode

Open a website

Opens a website link in the default web browser.

start <website_link>
Enter fullscreen mode Exit fullscreen mode

Display/Set the system date.

date
Enter fullscreen mode Exit fullscreen mode

Display/Set the system time.

time
Enter fullscreen mode Exit fullscreen mode

Cancel the process

Display Message

echo "message"
Enter fullscreen mode Exit fullscreen mode

Create new directory

mkdir <directory_name>
Enter fullscreen mode Exit fullscreen mode

Delete a folder

rmdir <directory_name>
Enter fullscreen mode Exit fullscreen mode

Deletes one or more files.

del <file_path>
Enter fullscreen mode Exit fullscreen mode

Move a file

move <source> <destination>
Enter fullscreen mode Exit fullscreen mode

Rename a file

rename <old_name> <new_name>
Enter fullscreen mode Exit fullscreen mode

Clear

Clears the command prompt screen.

cls
Enter fullscreen mode Exit fullscreen mode

Exit Commannd prompt

Exits the command prompt or a batch script.

exit
Enter fullscreen mode Exit fullscreen mode

Top comments (0)