Computing.Net > Forums > Programming > Simple Batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Simple Batch

Reply to Message Icon

Name: AKL-MFCU
Date: February 24, 2006 at 13:03:06 Pacific
OS: Windows XP
CPU/Ram: 2.8ghz / 1 GB DDR500
Product: Self
Comment:

Hey again,

I am looking for a simple batch that I can run nightly to update our forms on all of our server locations. I want them to match server A's folders and subfolders exactly after every run that night. So basically I want it to copy over everything that is in this UNC path's folder and subfolder

\\serverA\fl01\jetform\forms

to all other servers that can be put into another batch or txt file to call the info from (whichever is easier for you) that will contain the server names:

serverB
serverC
serverD
etc.

and will replace that variable in the unc path where server A is in xcopying it (with overwriting, and everything being forced, no prompting).

However, I want it to also make sure and run through the files and subfolder(s) and files and make sure that they match exactly that of server A, no more and no less. So if there is file z.pdf and that isn't on serverA i want it to delete that file. Is this possible? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: February 25, 2006 at 00:24:46 Pacific
Reply:

I guess that eliminating 'strays' lilke z.pdf is as simple as deleting everything before the xcopy starts.

for /f %%S in (servname.lst) do xcopy \\serverA\fl01\jetform\forms %%S


If at first you don't succeed, you're about average.

M2


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Simple Batch

Simple Batch file www.computing.net/answers/programming/simple-batch-file/10948.html

simple batch file prog q.. www.computing.net/answers/programming/simple-batch-file-prog-q/14278.html

Simple Batch Script help www.computing.net/answers/programming/simple-batch-script-help/12744.html