Solved

Software to move folders

Posted on 2008-06-10
6
195 Views
Last Modified: 2010-04-21
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!
0
Comment
Question by:hjmission
  • 3
  • 3
6 Comments
 
LVL 32

Expert Comment

by:r-k
ID: 21752399
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.

Namely:

  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.
0
 
LVL 1

Author Comment

by:hjmission
ID: 21752456
r-k    will that move a complete folder?  Can you use a wildcard with that?
0
 
LVL 32

Accepted Solution

by:
r-k earned 500 total points
ID: 21752794
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.

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:hjmission
ID: 21752919
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?
0
 
LVL 32

Expert Comment

by:r-k
ID: 21753756
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.
0
 
LVL 1

Author Closing Comment

by:hjmission
ID: 31468926
r-k  thanks for all of your help.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Independent domain networks for setup 6 117
Computer software inventory 5 98
Command prompt output to variable? 9 47
How can i echo a ! to end of a file? 8 16
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question