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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mirroring a directory

Status
Not open for further replies.

nino15

Technical User
Mar 20, 2007
2
FR
Hello,

I would like to make a vbs script that create a mirror of a directory (with folders, sub-folders, files ...) every day. Exactly like robocopy /mir can do...
Do you have any solutions ?
 
Is there some reason that you can't use Robocopy?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I will prefer to have all in one script file (not calling any exe). If i don't find solution, I will use robocopy
 
Well, if you were going to write one yourself, I would search this forum and especially look for FileSystemObject.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I wouldn't think that would be particularly efficient or accurate. If you don't tell it to overwrite, then newer files in the source folder will not be updated in the copy folder. If you do tell it to overwrite, then every file will be copied even if it did not need to be.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
In addition, the /MIR option for robocopy will delete files in the target folder that no longer exist in the source folder. CopyFolder would not replicate this.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Okay, I don't read op's command line. Just send a lead. He has to make an effort of his own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top