Copy Fail
-
Hi All, Can any one help me in how to format the command for Run method in script ? i have tried different way in giving input for Run method but it doent work , can any one look into below code Below code is doing a XCopy for source to destination . Set oShell = CreateObject("WScript.Shell") RetVal = oShell.Run("""C:\Program Files\XYZ\ABC\XCopy.exe"" ""C:\Program Files\XYZ\ABC\staging\Advance NDC\utility\vvv.txt"" ""C:\Program Files\XYZ\ABC\utility\vvv.txt"" / s / q / y", 2, True)
-
Hi All, Can any one help me in how to format the command for Run method in script ? i have tried different way in giving input for Run method but it doent work , can any one look into below code Below code is doing a XCopy for source to destination . Set oShell = CreateObject("WScript.Shell") RetVal = oShell.Run("""C:\Program Files\XYZ\ABC\XCopy.exe"" ""C:\Program Files\XYZ\ABC\staging\Advance NDC\utility\vvv.txt"" ""C:\Program Files\XYZ\ABC\utility\vvv.txt"" / s / q / y", 2, True)
IT doesn work because you're putting spaces between the forward slashes and the commands. You've got: (BTW: I hope you have XCOPY.EXE in that folder you specified!)
"...XCopy.exe" "C:\\..." "C:\\..." / s / q / y"
When it should be:
"...XCopy.exe" "C:\\..." "C:\\..." **/s /q /y**"
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
IT doesn work because you're putting spaces between the forward slashes and the commands. You've got: (BTW: I hope you have XCOPY.EXE in that folder you specified!)
"...XCopy.exe" "C:\\..." "C:\\..." / s / q / y"
When it should be:
"...XCopy.exe" "C:\\..." "C:\\..." **/s /q /y**"
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...