Copy Folders Using FSO

Discussion in 'Software' started by CobolExpert, Jul 19, 2004.

  1. CobolExpert

    CobolExpert Private E-2

    I want to copy a folder (containing subfolders and files) from one server to another - overwriting anything existing. Unfortunately, with the script below, it runs the first time and then gives me a permission denied on the second part (I am assuming its saying it can't overwrite the files). Has anyone else run into this or know what I can use to copy and overwrite?

    *** The part of the script doing the copy ***
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.CopyFolder "\\server1\Setup\Tools" , "\\server2\Tools" , True
    ***********************************

    I thought maybe I could just delete the folder on server2 before the copy but that seems like extra work (that the overwrite flag should handle) and I couldn't get it to work with a folder that has subfolders.


    Thanks!
    JB
     
  2. CobolExpert

    CobolExpert Private E-2

    One of the damn files was marked as read only. Took that off and HEY I can overwrite it. Amazing.
     
  3. da chicken

    da chicken MajorGeek

    Hey, that read-only flag is a sneaky bugger.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds