c++ - Calling system() with a batch file containing ECHO fails -
i have of perculiar situation here.
i have application calls system() run simple batch file, 1 or 2 echo, type command concatenates 1 file check error 1 or 2 echo more , exit proper code.
the application c++ , runs file when called directly.
however when called application, 1 c# batch file call fails unless remove echo statements in it.
i suspect chaining system() (or equivalent) calls causes failure.
the first call (c#) has no redirection of standard out or std err
initialprocess.startinfo.createnowindow = false; initialprocess.startinfo.redirectstandardoutput = false; initialprocess.startinfo.redirectstandarderror = false; nor second 1 (the call system() not support io redirect, 1 must use _popen)
so question is...
why on earth echo cause batch file fail when called long chain (c# calling c++ calling batch file) works file in short chain (c++ calling batch file)
the same c++ executable use, on same machine identical environment (least can tell).
Comments
Post a Comment