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

Copy folders/files only if it does not exists in the destination

Status
Not open for further replies.

tbscmgi

MIS
Sep 17, 2003
66
US
I'm trying to copy folders/files from \\it\prod\*, to \\it\backup\prod
but only if the folders/files does not exists in the \\it\backup\prod.

I'm using vbscript.

Thanks for any help in advance.
 
I'm using vbscript
So, what have you tried so far and where are you stuck in your code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sub ShowCopyFileBackup
FCF = "\\isd-track\images\* "
FCT = "\\isd\backup\testi"
FSO.CopyFolder FCF , FCT

FCF = "\\isd-track\prod\* "
FCT = "\\isd\backup\testp"
FSO.CopyFolder FCF , FCT
End Sub

The problem I'm having is that when the user run this script it keeping coping the same over again. I only want to copy the folders/files when if does not exsist if FCT.

Thanks
 
What about this ?
FSO.CopyFolder FCF , FCT[!], False[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
it didn't work
What happens ? any error message ? unexpected behaviour ? computer crash ? ... ?
 
Why don't you just use RoboCopy.exe that you can get from MS??

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top