none
Help with VBS script to copy folder if it does not exist RRS feed

  • Question

  • Hi,

    I have a simple VBS script which copies a folder and its contents from a network share to the C drive of a PC. I have created a group policy which runs this script on PC startup. I need this script to check if the folder exists first and only initiate the copy if it does not exist.

    This is what i have so far

    Set FSO =CreateObject("scripting.FileSystemObject")
    FSO.CopyFolder "\\server\netshare\folder1" ,"C:\folder1", True

    Can anyone advise what i need to add to the above script to achieve this?

    Thanks in advance

    Wednesday, November 29, 2017 9:33 AM

Answers

  • if fso.FolderExists("folderapth") Then WScript.Quit
        ....

    \_(ツ)_/



    • Edited by jrv Wednesday, November 29, 2017 9:47 AM
    • Marked as answer by Deano82 Wednesday, November 29, 2017 2:09 PM
    Wednesday, November 29, 2017 9:46 AM

All replies