Basic Commands
echo Hello World
cls
pause
exit
Navigation
cd path
cd..
dir
tree /f
File & Directory
mkdir foldername
rmdir foldername /s /q
copy source destination
move source destination
del filename
Variables
set var=Hello
echo %var%
set /p var=Enter value:
Loops
for %%i in (*.txt) do echo %%i
for /l %%i in (1,1,5) do echo %%i
Conditionals
if %a%==%b% echo Equal
if not %a%==%b% echo Not Equal
if exist file.txt echo File exists
Redirection & Pipes
command > file.txt
command >> file.txt
command1 | command2
Networking
ping google.com
ipconfig
tracert google.com
netstat -an
System Info
systeminfo
tasklist
taskkill /im notepad.exe /f
hostname
Help & Documentation
command /?
help
|