# Open file .exe

**URL:** <https://rubytalk.org/t/open-file-exe/63385>\
**Category:** ruby-talk\
**Created:** [19 August 2011 09:23 UTC](https://rubytalk.org/t/open-file-exe/63385 "2011-08-19T09:23:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yabir\_G](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@Yabir\_G](https://rubytalk.org/u/Yabir_G)\
**Post date:** [19 August 2011 09:23 UTC](https://rubytalk.org/t/open-file-exe/63385/1 "2011-08-19T09:23:18Z")

</div>

How i can open a exe file with ruby

thanks

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Phillip\_Gawlowski](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@Phillip\_Gawlowski](https://rubytalk.org/u/Phillip_Gawlowski)\
**Post date:** [19 August 2011 12:10 UTC](https://rubytalk.org/t/open-file-exe/63385/2 "2011-08-19T12:10:01Z")

</div>

File.open("myfile.exe", "b")

What's the problem you are actually having? 🙂

> **···**
>
> On Fri, Aug 19, 2011 at 11:23 AM, Yábir G. \<cometa199@gmail.com\> wrote:
> 
> > How i can open a exe file with ruby
> 
> --  
> Phillip Gawlowski
> 
> phgaw.posterous.com | twitter.com/phgaw | gplus.to/phgaw
> 
> A method of solution is perfect if we can forsee from the start,  
> and even prove, that following that method we shall attain our aim.  
> -- Leibniz

---

<div class="post-metadata">

**Author:** ![11142](https://avatars.discourse-cdn.com/v4/letter/1/e0b2c6/32.png) [@11142](https://rubytalk.org/u/11142)\
**Post date:** [19 August 2011 15:54 UTC](https://rubytalk.org/t/open-file-exe/63385/3 "2011-08-19T15:54:31Z")

</div>

Do you want to open the file (as in, read its contents) or run it (execute)?

Philip gave you solution for the first case, the simples one for  
running is `myfile.exe` (note the backticks).

-- Matma Rex

> **···**
>
> 2011/8/19 Phillip Gawlowski \<cmdjackryan@gmail.com\>:
> 
> > On Fri, Aug 19, 2011 at 11:23 AM, Yábir G. \<cometa199@gmail.com\> wrote:
> > 
> > > How i can open a exe file with ruby
> > 
> > File.open("myfile.exe", "b")
> > 
> > What's the problem you are actually having? 🙂
> > 
> > --  
> > Phillip Gawlowski
> > 
> > phgaw.posterous.com | twitter.com/phgaw | gplus.to/phgaw
> > 
> > A method of solution is perfect if we can forsee from the start,  
> > and even prove, that following that method we shall attain our aim.  
> > -- Leibniz
