DOS Command Line Getting Truncated
Keywords: 1932 winexec The parameter is incorrect.
Question:
I am having trouble getting the following code to work. the /XF saids to exclude files that match what follows *.CMD*.BAT etc... it works fine if I just put one *.cmd, but not any more than thatThe error when I run it is:
1932 winexec The parameter is incorrect.That's because the command gets truncated after @ in @wait). It is as if the line is too long, but it is not. I have up to 255 chars, the line is about 160 chars.This same code works fine as a DOS .BAT file. I am using Windows NT 4.0 Any answers, workarounds? Here's my code:
Runenviron("command.com","/c ROBOCOPY \\BPRSMTL01\Releases\Current\afc c:\pgms\%Server% *.* /L /R:2 /W:30 /XF *.CMD *.ROX > C:\PGMS\RBC\TST01.TXT",@normal,@wait)Answer:
Your code looks vaguely OK. The command line might be too long for command.com
- Since you are on NT try cmd.exe instead of command.com.
- If that does not work make a DOS bat file as follows:
REM NAME ROBO.BAT REM note server changed ROBOCOPY \\BPRSMTL01\Releases\Current\afc c:\pgms\%1 *.* /L /R:2 /W:30 /XF *.CMD *.ROX > C:\PGMS\RBC\TST01.TXTThen your WinBatch line would be:runenviron("robo.bat",Server,@normal,@wait)
Article ID: W12881Filename: DOS Command Line Getting Truncated.txt