chobus
asked on
VB Script to copy files if file doesn't exist in target directory.
I found this code that someone posted and it works great except I want to make it copy all sub folders and files with file ownership and ACL information. Can this even be done?
Const strSOURCE = "c:\test\"
Const strTARGET = "c:\test-2\"
Set fso = CreateObject("Scripting.Fi leSystemOb ject")
Set fol = fso.GetFolder(strSOURCE)
For Each fil in fol.Files
If (Not fso.FileExists(strTARGET & fil.Name)) Then
fso.Copyfile strSOURCE & fil.Name, strTarget, true
End If
Next
MsgBox lngCount & " files copied", vbInformation , "Image Copy Complete"
Const strSOURCE = "c:\test\"
Const strTARGET = "c:\test-2\"
Set fso = CreateObject("Scripting.Fi
Set fol = fso.GetFolder(strSOURCE)
For Each fil in fol.Files
If (Not fso.FileExists(strTARGET & fil.Name)) Then
fso.Copyfile strSOURCE & fil.Name, strTarget, true
End If
Next
MsgBox lngCount & " files copied", vbInformation , "Image Copy Complete"
ASKER
What is Robocopy? Can it copy to Network Drives?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How do I get Robocopy? I didn't see a download at http://www.ss64.com/nt/robocopy.html
ASKER
I found a Windows Server 2003 Resource Kit Tools that has it but what can I do for Windows server 2000?
You can download the resource kit for windows 2003 as robocopy is part of it.
Robocopy GUI can be downloaded here
http://www.microsoft.com/technet/technetmag/issues/2006/11/UtilitySpotlight/
Robocopy GUI can be downloaded here
http://www.microsoft.com/technet/technetmag/issues/2006/11/UtilitySpotlight/
Give it a try