Solved

Software to move folders

Posted on 2008-06-10
6
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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