Windows Command: Move files and directories to another location


This tutorial explains how to move files or directories to another location on a Windows system.

Move files to another directory

move filename destinationFolder

Example: to move file ‘data.docx’ to the folder ‘d:\backup\folder’

move  data.docx  d:\backup\folder\

You can also rename the file while moving it to the new location

move data.docx  d:\backup\folder\newData.docx

We can’t move multiple files with single command. i.e the below command would not work.

move file1 file2  D:\folder1\folder2

This would give the error The syntax of the command is incorrect.

However we can use wildcards to move files in bulk.  For example, if you want to move all text files from current folder to a new location you can use the below command.

move *.txt  destinationDirectory

To move all files starting with letter ‘A’, you can use below command.

move A*  destinationDirectory

Move directories


move directory newDirectoryPath

Example: To move the directory ‘data’ to ‘D:\data\folder1\’

move data D:\data\folder1

1. Can we move multiple directories using wild cards like the way we do it with files?
No, wild cards does not work for directories. You get the below error

C:\>move tmp* Documents\folder1\
The filename, directory name, or volume label syntax is incorrect.

2. How to specify the directories/files which have white spaces in the names?
You need to enclose the file or the directory name in double quotes.

Example: move "file with spaces"  "D:\directory with spaces"

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s