Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Thread Tools Rate Thread Display Modes
Old 12-10-2003, 12:39 PM
gilc gilc is online now
Registered User
Join Date: 12-10-2003
Posts: 3
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

Reply With Quote
Old 12-10-2003, 04:47 PM
gilc gilc is online now
Registered User
Join Date: 12-10-2003
Posts: 3
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.
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

All times are GMT -5. The time now is 04:32 PM.

Copyright 1999-2019 Kinook Software, Inc.