Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   Invoking a batch file with Ruby on Windows (http://www.velocityreviews.com/forums/t832628-invoking-a-batch-file-with-ruby-on-windows.html)

brian.kejser@protexis.com 08-20-2006 11:28 PM

Invoking a batch file with Ruby on Windows
 
Hi

Does anyone know how I could invoke a Windows batch file (e.g.
MyBatchFile.bat) and check the ERRORLEVEL environment variable after the
batch file completes execution.

Thanks



Jan Svitok 08-21-2006 12:04 AM

Re: Invoking a batch file with Ruby on Windows
 
On 8/21/06, brian.kejser@protexis.com <brian.kejser@protexis.com> wrote:
> Hi
>
> Does anyone know how I could invoke a Windows batch file (e.g.
> MyBatchFile.bat) and check the ERRORLEVEL environment variable after the
> batch file completes execution.
>
> Thanks


1. Try:
- `MyBatchFile.bat`
- system "MyBatchFile.bat"
- the same but with "cmd /c MyBatchFile.bat" (or /k , I don't remember exactly)

$? should contain the errorlevel (exit status)

I'm writing out of my head, if that won't help, just ask again,
tomorrow (i.e. in 10 hours) I can provide the right solution from my
code.

J.



All times are GMT. The time now is 08:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.