|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
How to get VisualBuild (3.x) to recognize ERRORLEVEL from a batch file?
In Windows2000 and later we have the ability to exit a batch file and have it return an error code:
for instance exit /b %ERRORLEVEL% But, since batch files are invoked via %DOSCMD% which is for simplicity cmd.exe /c, the error value that visual build knows about is from cmd.exe, not the batch file. cmd.exe doesn't seem to pass this error back. As far as cmd.exe knows (thus Visual Build) cmd.exe executed just fine. It doesn't seem to have an issue with built in commands like copy. They fail and Visual Build knows about it. I realize there's probably nothing Kinook can do about it, but I would like to be able to have a batch file failure stop my build. The only way I can think of is to write my own .exe that launches the batch file via shell and get the return code, but I haven't tested it to see if even that is possible. But in case somebody has already solved this issue, I'd like to hear about your solution. FYI: using Visual Build 3.5b on WindowsXP Pro Thanks |
#2
|
|||
|
|||
Never mind, I got it.
I was using: %DOSCMD% file.bat What needs to be done is: %DOSCMD% call file.bat In case anybody else needed to know. |
|
|