Working with files
Copying
Use copy
(copy) to copy. You have to provide a source and destination path.
Copy 'test.txt' to 'copy.txt' (both in the current directory)
copy test.txt copy.txt
Copy 'test.txt' to another location
copy test.txt c:\Users\alice\documents\copy.txt
You can copy entire directories (and their contents) with the xcopy
command.
Copy the directory 'music' to 'music2'
xcopy music music2
Moving and rename
Use move
move/rename files and directories. You have to provide a source and destination path.
Rename 'test.txt' to 'copy.txt'
move test.txt copy.txt
Move 'test.txt' to the parent directory (note since we don't want to change the filename we can just specify the directory)
move test.txt ..
You can also move directories (and their contents).
Move the directory 'music' to 'music2'
move music music2
Move the directory 'music' to an existing subdirectory (note the trailing slash)
move music old/
Deleting
Use del
(del) to delete files.
Delete 'test.txt'
del test.txt