From: Eric Christopherson Date: 2010-02-28T02:49:35+09:00 Subject: Re: running a file On Sat, Feb 27, 2010 at 11:20 AM, Siep Korteling wrote: > Eric Christopherson wrote: >> On Fri, Feb 26, 2010 at 7:30 PM, John Pasqa >> wrote: >>> ok, i'm writing a ruby program that interprets some text and does stuff >>> with it, but thats not what i'm here to ask about. >>> What I want to know is how would I make it so the user can right-click >>> and open a file with my program. Just like how if you right click a .rb >>> file you can run it with the ruby MRI. All I need is to get the text in >>> the file into a variable in the program when the user opens it. Any >>> suggestions? >> >> Assuming you're using Windows, you will most likely have to edit the >> registry entry for the file type you want to open with your script. > > Open explorer, menu Extra --> Folder options --> tab File types, select > the file type, for instance .txt -->  advanced --> new > > Under "action" type a name > The other textfield should propably something like > path\to\ruby.exe path\to\your_progam.rb %1 Siep, I was about to suggest the same thing, except when I tried it, it said it couldn't find the Ruby executable. It turned out that I needed to put quotes around the Ruby pathname (since it has spaces on my machine).