Software to move folders

I am looking for some type of software that I can use to schedule an automatic move of files from one MS server to another MS server.  Does anybody know of any software like that?  Thanks for your help!
Who is Participating?
r-kConnect With a Mentor Commented:
Yes, you can move entire folders and sub-fodlers within, with the xcopy command. For example:

 xcopy J:\myfolder\*.* /s/e K:\myfolder\ /c/f/h/d/y

will move everything in \myfolder\ on the J: drive to a corresponding folder on the K: drive, including all sub-folders below \myfolder\

The switches I used above are:

Rem       /s  means all subdirectories also
Rem       /e  means empty folders also
Rem       /c  means ignore errors
Rem       /f  means full display in console window
Rem       /h  means hidden files also copied
Rem       /d  means copy only those files that have changed
Rem       /y  means do not prompt for overwriting existing files

Type "xcopy /?" at a command prompt to see other options.

In your case you may want to leave out the /c switch so you don't ignore errors. Another useful option is /exclude where you can have a list of files withing those folders you don't want want copied.

Be sure not to run the "del" command if the xcopy encounters any error (network down e.g.).

There is a limitation of the xcopy command that you should be aware of. It cannot copy files with the path or name longer than a certain length (128 or 256, I forget which). You can check if this applies in your case by running a test run of xcopy on the folders of interest.

Assuming the files are not "in use" at that time, you should be able to do this by just putting a couple of commands in a batch file and scheduling it to run at time you want.


  xcopy to copy the folder and its subfolders.
  del to delete the folders that have been copied.

You will want to put in some logic to not do "del" if any of the xcopy failed. And carefully test something like this to avoid losing files.
hjmissionAuthor Commented:
r-k    will that move a complete folder?  Can you use a wildcard with that?
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

hjmissionAuthor Commented:
r-k      this looks like what i am wanting.  Can I run this command with something like Task Scheduler so I can get it done everyday?
Yes, you can put all your commands in a file named "something.bat", then schedule it with the task scheduler like any other program.

Testing and error checking are important, of course.

I have to run but I'll post some tips later on how you can save a log of what gets copied, and an error log.

You can also include a command to map a network drive in the same command/batch file.
hjmissionAuthor Commented:
r-k  thanks for all of your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.