Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syncing folders in one direction

Status
Not open for further replies.

Nelviticus

Programmer
Sep 9, 2003
1,819
0
36
GB
Hi there, I've never written any VBScript so I have no idea where to start with this.

When our users log on we run a DOS batch script to copy some of our MS Office templates to a folder on their C drives so that (amongst other reasons) laptop users have access to them when they're out of the office. However this doesn't remove any templates that shouldn't be there, such as ones we decide to delete.

How easy is it to write a script that will:
- Copy templates from the source folder if they're newer than the ones in the destination, and
- Delete any templates that exist in the destination folder but don't exist in the source
?

We could do 'delete all' followed by 'copy all' but some of these files are pretty big and this will happen every time each user logs on.

Thanks!

Nelviticus
 
Hi,

Have you looked at robocopy.exe from Microaoft - this will doo all this for you with the correct switches.

;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top