Results 1 to 2 of 2

Thread: Issues with copying files using .vbs

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2020

    Issues with copying files using .vbs

    Hi All,

    Sorry for my total lack of knowledge here - I have been asked to create a VBS file that will copy files from a central location to the users C:\ overwriting the files already there.

    I have set the below script, which works if I run each line directly in CMD, but when i add them all to the script, it fails with a syntax error

    xcopy /s \\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\ExploreTS.exe.config "C:\Program Files (x86)\Explore\Synopsys\ExploreTS.XmlSerializers.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\ExploreTS.exe.config" "C:\Program Files (x86)\Explore\Synopsys\ExploreTS.XmlSerializers.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\ExploreTS.exe" "C:\Program Files (x86)\Explore\Synopsys\ExploreTS.exe" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\ExploreBR.XmlSerializers.dll" "C:\Program Files (x86)\Explore\Synopsys\ExploreBR.XmlSerializers.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\ExploreBR.dll" "C:\Program Files (x86)\Explore\Synopsys\ExploreBR.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\IHAGen.dll" "C:\Program Files (x86)\Explore\Synopsys\IHAGen.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\CheckBoxComboBox.dll" "C:\Program Files (x86)\Explore\Synopsys\CheckBoxComboBox.dll" /y
    xcopy /s "\\ewwinst01\DeployOmatic\IHA_Applications\EWWTSSQL01\ExploreTS\Microsoft.Office.Interop.Excel.d ll" "C:\Program Files (x86)\Explore\Synopsys\Microsoft.Office.Interop.Excel.dll" /y

    Can anyone assist a VBS newb here?

    Many Thanks

  2. #2
    Fanatic Member
    Join Date
    Nov 2017

    Re: Issues with copying files using .vbs

    A valid command line command isn't at all the same thing as a valid line of .vbs code. You didn't say what you did to add them to the script, but if what you did was copy and paste those commands into a text file and save that file with a .vbs extension, that certainly won't work.

    If in the end those commands get the job done, then the easiest method of solving this is to use a .bat file instead of a .vbs file. In that case, all you would do is copy those commands as-is to a text file and give it a .bat extension. Double-click the .bat file and it will run and copy the files as written.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width