15 pts.
Windows scripting
How can I use VBScript to copy the contents of a folder (including subfolders), but I only want it to copy new files/folders or ones that have been modified since the last copy.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I would recommend using robocopy instead of VBScript. Robocopy does this by default. If is part of the Windows 2000 resource kit.

Robocopy was included in the OS starting in Windows XP forward. The existing switches in one version are generally the same across newer versions. Add a check in your script for robocopy and copy to the system if not present (you may want to include OS version checking). Then you can use it to manage your copying. Great thing is robocopy provides a logging facility.

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Davlyn
    But that would involve downloading and installing it on all the systems that I am trying to have copy the files automatically 300+. I have a batch file that triggers durring startup, but it copies ALL the FIles, and none of the Sub-folders everytime the computer is started, which is what we want, but it would speed things up if it just do the files that are new, or have been modified, and we still need it to do the sub-folders.
    15 pointsBadges:
  • Denny Cherry
    Take the EXE, and wrap it up in an MSI using one of the MSI creation tools. Then use Active directory to install the MSI on all your systems. Or you can setup your existing batch file to copy the robocopy.exe from an fixed location to the local servers system32 folder then it will be available the next time you need it. Robocopy doesn't actually need to be installed. Windows comes with everything you need for it to run automatically. robocopy has switches which will will go through the folders and it automatically only copies files which have been changed since the last time it was run. Robocopy is still going to be your best option.
    69,005 pointsBadges:
  • Labnuke99
    Consider also using the excellent Sysinternals tools like psexec. This will allow you to copy and remotely execute a program on computers with authorized credentials.
    32,960 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: