Solved

Script/batch file to copy and rename select folders

Posted on 2007-03-26
3
389 Views
Last Modified: 2013-12-04
Dear experts!
I need a script/batch file for copying folders automatically from Windows Server (Small Business Edition) to a connected hard drive.

1) We have a directory on our server called PROJECTS. It contains subdirectories for each project we work on. Each subdirectory’s name begins with the project number (almost always four digits: 1001, 1002, 1003, etc.). It contains a short description after the project number, but always begins with the four (eventually five, I guess)-digit project number.
2) We want to write a script that COPIES project subdirectories from the PROJECT folder to a separate hard disk. The code would do the following:
- scan through the PROJECT folder’s subdirectories, looking for any project whose FIRST CHARACTER is ALPHA (not numeric).
- for that directory, it would check the other hard disk to see whether a similarly named folder already exists.
- if it does NOT exist, it would COPY the entire folder and then RENAME the source folder (either insert another character at the beginning or end of the folder name – we’re flexible on this naming convention).
- if it DOES exist, it would simply skip the folder. [nice to have: store this information in a text file generated at the end, ideally listing the folder size on the original and on the remote hard drive – strictly “nice to have”]

Thanks for your assistance on this!!

0
Comment
Question by:terpsichore
[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 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18794932
I would encourage you to use a solution like robocopy for this...it's what it was made for.
It can be setup to copy only changed data, if your source data is altered.

http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en is the link to download it from.

You can also save a job specification like you want it, so you'd simply call the program each time you needed to update.

If that sounds like a feasible solution for you, it's very simple to write a batch file to accomplish it....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The articles for turning off the Client firewall policy on the internet are for SBS 2008 and don't really help for SBS 2011. They actually moved the Client firewall policy. In 2011, the client firewall policy has moved to the SBS computers conta…
You may have discovered the 'Compatibility View Settings' workaround for making your SBS 2008 Remote Web Workplace 'connect to a computer' section stops 'working around' after a Windows 10 client upgrade.  That can be fixed so it 'works around' agai…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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