Windows CMD Advanced

Advanced Windows CMD commands and networking.

Network Commands

Ping host
ping google.com

Trace route
tracert google.com

DNS lookup
nslookup google.com

Network statistics
netstat
netstat -an // all connections

ARP cache
arp -a

Process Management

List running tasks
tasklist

Kill process by name
taskkill /IM notepad.exe

Kill process by PID
taskkill /PID 1234

Force kill
taskkill /F /IM program.exe

Start program
start notepad.exe

File Attributes

Show attributes
attrib file.txt

Set read-only
attrib +r file.txt

Remove read-only
attrib -r file.txt

Hide file
attrib +h file.txt

System file
attrib +s file.txt

Batch Scripts

Echo text
echo Hello World

Disable echo
@echo off

Pause execution
pause

Exit script
exit

If statement
if exist file.txt echo File exists