Command | Description |
---|---|
dir / a |
List directory including hidden files |
dir * .png |
List any file that ends in ".png" |
mkdir |
Make directory |
rmdir /s |
Remove directory and contents |
wmic logicaldisk get name |
List all drives |
e: |
S witch drive |
tree |
Folder structure |
attr i b |
File attributes |
attr i b +h file.txt |
Add file attributes |
attr i b -h file.txt |
Remove file attributes |
echo hello > file.txt |
Create file on the fly |
type file.txt |
Read contents of a file |
del file.txt |
Delete file |
echo hello > file.txt |
Overwrite file text (1. file.txt = "hello") |
echo world > file.txt |
Overwrite file text (2. file.txt = "world") |
echo hello > file.txt |
Append to a file (1. file.txt = "hello") |
echo world >> file.txt |
Append to a file (2. file.txt = "hello world") |
dir > directory.txt |
Command results to file |
copy source.text copy/here |
Copy a file to a directory |
xcop y folder1 folder2 |
Copy contents from folder1 to folder2 (no sub-directories) |
xcop y folder1 folder2 /s |
Copy contents from folder1 to folder2 (inc sub-directories) |
move folder1 folder2 |
Move a directory, folder1 into folder2 |
rename folder1 folderA |
Rename a directory |
Command | Description |
---|---|
cls |
Clear CMD |
command /? |
Show help/options for a command |
Type file name in directory | open file in default program |
path |
Show environment path |
color /? |
List all available colours |
color 0A |
Change colours |
color |
Default colours |
mistake in "attrib" command