From: Wi siong Ko Date: 2009-12-22T13:17:54+09:00 Subject: Re: Cannot obtain child process exit code on Windows Lars Christensen wrote: > You can change your .bat: > > C:\>type b.bat > @echo off > exit 29 > > C:\>cmd /c b.bat > > C:\>echo %errorlevel% > 29 > > But this .bat will exit your console window if run from the command > line. This may help though: > http://stackoverflow.com/questions/377407/detecting-how-a-batch-file-was-executed Thank you for the explanation and solution. The cmd /c works great for my purpose. -- Posted via http://www.ruby-forum.com/.