List files in the current directory
dir
Display computer name
hostname
List all .txt files
dir *.txt
Save output to a file
>
Display file attributes
attrib
Change to the parent directory
cd ..
View IP configuration
ipconfig
Delete all .tmp files
del *.tmp
Append output to a file
>>
Make a file read-only
attrib +r filename.txt
Create a folder named Reports
mkdir Reports
Show Windows version
ver
List all files starting with "log"
dir log*
Read file input into a command
<
Remove the hidden attribute
attrib -h filename.txt
Copy files to another location
copy
Display all running processes with their process IDs
tasklist
Copy all .bat files to a folder called Backup
copy *.bat c:\Backup
Combine output from two commands
|
Show which users and groups have permissions to access a file or folder
icacls filename.txt
Delete a folder and all contents
rmdir /s
List OS details and hotfixes
systeminfo
Move all .jpg and .png files
mpve *.jpg *.png Images
Save systeminfo to info.txt
systeminfo > info.txt
Change file ownership
takeown /f filename.txt