Avatar of terpsichore
terpsichore

asked on 

Script/batch file to copy and rename select folders

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!!

Microsoft DevelopmentMicrosoft Server OSSBS

Avatar of undefined
Last Comment
sirbounty
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SBS
SBS

Small Business Server (SBS) is a line of server operating systems targeted at small businesses by bundling the operating system with a number of other Microsoft products that would normally need to be purchased or licensed separately. The most notable inclusions are Exchange, SQL Server, SharePoint and ISA/TMG (Microsoft's firewall and proxy server).

59K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo