Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert How to run exe file in ruby?...

Replytotopic

How to run exe file in ruby?

Posted in Forums : Ask a Rails expert

 
Profile

Authority 12
Posting Rating 0
Sign in to rate this post

Hello All,
Do u know how to run exe file in ruby?
I am expecting something like this :

ruby_built_in_method(“E:\locations\file.exe”) OR any way??

Thanks

 
Foto

Authority 37
Posting Rating 94
Sign in to rate this post

Hi Abdul,
you can run an exe file in Ruby as follows (i.e.):

system("C:\\Program Files\\file.exe")

I hope that you find useful.
greets

 
664297762

Authority 50
Posting Rating 95
Sign in to rate this post

Hi abdul,

You can even run an exe in your .rb like :

`C:\\Program Files\\file.exe`

Same you can run on your projects ruby console like :

\>> `C:\\Program Files\\file.exe`

  • Note : – Just need to place filename-with-location into ` ` this quotes. ;)

Good luck..! :)

Cheersss!

-Ganesh Kathare.

 
Profile

Authority 12
Posting Rating 0
Sign in to rate this post

WOW!!
Thanks both of u to reply me.

 
Www

Authority 87
Posting Rating 2
Sign in to rate this post

Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

you can also do it as

exec(“my_app.exe”)

exec will throw an error if the exe will not be executed, whereas
system()will return true if exe runs properly and false otherwise

On 2/15/07, SonOfLilit <sonoflilit /> wrote:
>
> try a system() call.
>
> Have a look in the docs at Kernel#system .
>
> Also have a look at the adopt-a-newbie thread.
>
> Aur Saraf
>
> On 2/15/07, yukme <yu-xiaobing /> wrote:
> >
> > There is a executable file named “my_app.exe” and i want to run it in my
> > ruby program.
> > How should i do?
> > thanks
> >
> >—
> > Posted via http://www.ruby-forum.com/.
> >
> >
>


http://www.railsteam.com

 
Profile

Authority 0
Posting Rating 0
Sign in to rate this post

Thanks Rails Team..

Prathap Rajamani

Replytotopic

Other Recent Topics

Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController

Ask a Rails expert : Best way to structure a database for a large/static dataset

Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)

Ask a Rails expert : Above Ground Pool Supplies

Ask a Rails expert : How to get url params in observer or model in Rails 3.1

Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?

Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?

Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )

Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob

Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel