Page 1 of 1

Running Program cmd

Posted: Tue Sep 22, 2009 12:29 pm
by KennethLee
Hi again,

I may have found a bug? Not sure, but I know for sure what I'm trying to do is not working.

I'm using the Run Program statement and trying to run the command,
cmd /c xcopy /e "$TARGETDIR$\\Config" "$TARGETDIR\\Backup $VERSION\\Config\\" as such:

Code: Select all

 Run Program cmd /c xcopy /e "$TARGETDIR$\\Config" "$TARGETDIR\\Backup $VERSION\\Config\\" (WAIT)
This does not seem to work. I tried doing this:

Code: Select all

Set Variable TEST to /c xcopy /e "$TARGETDIR$\\Config" "$TARGETDIR\\Backup $VERSION\\Config\\"
Run Program cmd $TEST$ (WAIT)
it works.

Why is an intermediate variable necessary? And please fix.

Thanks,
Kenneth

P.S. Also when I add a message box to show the command, it shows the following:

---------------------------
Test
---------------------------
cmd /c xcopy "C:\\\\TestApp\\Config" "C:\\\\TestApp\\Backup 3.3\\Config\\"
---------------------------
OK
---------------------------

The code for the above message box is:
MessageBox: Test, cmd /c xcopy /e "$TARGETDIR$\\Config" "$TARGETDIR\\Backup $VERSION\\Config\\"

There seems to be a double slash for C:\\\\

Posted: Wed Sep 23, 2009 8:47 am
by Bar_BQ
Hi,


It's not necessary to run cmd command. You may run xcopy.exe without cmd. All copy parameters put to Command line parameters field. I used it many times and there were no problems.

Posted: Wed Sep 23, 2009 9:30 am
by KennethLee
Good call there Bar_BQ, I didn't notice that xcopy is a program, unlike copy. I'll try using xcopy without the cmd. Thanks.

Still kind of strange that an intermediate variable is required for the Run Program to run the cmd command with arguments properly, but my problem is fixed.

=)