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?

PaulD
  • 809
  • try putting an ampersand in after the trailing argument. – Frank Thomas Jul 15 '14 at 13:53
  • @FrankThomas, nada, same result. – PaulD Jul 16 '14 at 07:41
  • then try a semicolon. from what I'm seeing here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true a semicolon will "end" a parameter. – Frank Thomas Jul 16 '14 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 05 '15 at 12:36

1 Answers1

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
JosefZ
  • 13,217