3

I have a program, named IsCmdBld.exe, which is doing some job for me. The problem is, when I'm trying to redirect its output to the log file on a disk, the program can't determine the end of the parameter line.

Example:

"IsCmdBld.exe" -p param1 -tparam2 -sparam3 > "log.txt"

Result:

IsCmdBld error: the parameter " > "log.txt" " is not preceded by a switch.

Is there any way to circumvent such a problem?

4
  • try putting an ampersand in after the trailing argument. Jul 15, 2014 at 13:53
  • @FrankThomas, nada, same result.
    – PaulD
    Jul 16, 2014 at 7:41
  • then try a semicolon. from what I'm seeing here: microsoft.com/resources/documentation/windows/xp/all/proddocs/… a semicolon will "end" a parameter. Jul 16, 2014 at 11:38
  • Weird, in a CmdLine-Parser (or BatchLine-Parser as well) that > redirector should split the command line in such way that rest of line including > will not be passed to program called... But previous parameters: does anyone contain an unquoted sign with special meaning in cmd, e.g. ", ^, &, |, <, >, (, ), % or !? However, maybe your IsCmdBld.exe program allows a parameter (switch) which could enable creating a verbose process log file?
    – JosefZ
    Jan 5, 2015 at 12:36

1 Answer 1

0

Write a batch script, name it e.g. icb.bat and instead of IsCmdBld launch icb:

icb -p param1 -tparam2 -sparam3 > "log.txt"

The script could be a follows:

:: icb.bat begin

"IsCmdBld.exe" %*

@goto :eof
:: icb.bat end

If used in a script already, then bring to bear next block syntax with parentheses:

:: some code
(
  "IsCmdBld.exe" -p param1 -tparam2 -sparam3
) > "log.txt"
:: another code
1
  • the problem is not actual anymore but thank you for your effort :)
    – PaulD
    Jan 16, 2015 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .