WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DOS

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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 that

The 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
  1. Since you are on NT try cmd.exe instead of command.com.

  2. 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.TXT
    
    Then your WinBatch line would be:
    
    	runenviron("robo.bat",Server,@normal,@wait)
    

    Article ID:   W12881
    
    Filename:   DOS Command Line Getting Truncated.txt
    File Created: 2001:01:25:15:49:58
    Last Updated: 2001:01:25:15:49:58