Seeking simple way to make foo.rb executable on Windows (e.g. !bin/sh...)

On unix I could put some shell prefix at the front of a file and make a
FOO.rb file directly executable.

Is there any equivalent in Windows? I want to be able to put my simple
scripts onto my desktop or Start menu and run them. Needless to say I really
don’t want to do any kind of executable “packaging”.

Thanks

— Its Me itsme213@hotmail.com wrote:

On unix I could put some shell prefix at the front of a file and make a
FOO.rb file directly executable.

Is there any equivalent in Windows? I want to be able to put my simple

Register all .rb file types to running the ruby interpreter. Failing that,
Just create a shortcut to the main program, and have a batch file that
does:

···

start ruby.exe c:\some_file.rb

– Thomas Adam

=====
“The Linux Weekend Mechanic” – http://linuxgazette.net
“TAG Editor” – http://linuxgazette.net

“ We’ll just save up your sins, Thomas, and punish
you for all of them at once when you get better. The
experience will probably kill you. :)”

– Benjamin A. Okopnik (Linux Gazette Technical Editor)


WIN FREE WORLDWIDE FLIGHTS - nominate a cafe in the Yahoo! Mail Internet Cafe Awards Yahoo is part of the Yahoo family of brands

Hi,

Its Me wrote:

On unix I could put some shell prefix at the front of a file and make a
FOO.rb file directly executable.

Is there any equivalent in Windows? I want to be able to put my simple
scripts onto my desktop or Start menu and run them. Needless to say I really
don’t want to do any kind of executable “packaging”.

If you’re using the Win-Installer you should be able to call any ruby
file (with a .rb extension) from the command line, at least if you’re
running WinXP or Win2K (WinNT may behave similarly but I can’t test it)

IIRC ftype is the command to set and view this behaviour.

Happy rubying

Stephan

Its Me wrote:

On unix I could put some shell prefix at the front of a file and make a
FOO.rb file directly executable.

Not to be a pedant, but in unix you still need to chmod it
executable; simply having the #! in the file did not make it
directly executable.

“Its Me” itsme213@hotmail.com schrieb im Newsbeitrag
news:XoHbc.37006$o_.22902@fe1.texas.rr.com

On unix I could put some shell prefix at the front of a file and make a
FOO.rb file directly executable.

Is there any equivalent in Windows? I want to be able to put my simple
scripts onto my desktop or Start menu and run them. Needless to say I
really
don’t want to do any kind of executable “packaging”.

The easiest way is via the explorer: right click on some .rb file, “open
with” and select the ruby interpreter - if the association hasn’t been made
already by the installer.

robert

Stephan Kämper wrote:

If you're using the Win-Installer you should be able to call any ruby file (with a .rb extension) from the command line, at least if you're running WinXP or Win2K (WinNT may behave similarly but I can't test it)

IIRC ftype is the command to set and view this behaviour.

  On Win2K and WinXP, ftype /? will give some instruction on adding
  filetype associations.

  (Didn't know about ftype until now. Thanks!)

  James

Great!! Thanks, James.

“James Britt” jamesUNDERBARb@neurogami.com wrote in message
news:406F61CB.7020909@neurogami.com

···

On Win2K and WinXP, ftype /? will give some instruction on adding
filetype associations.

(Didn’t know about ftype until now. Thanks!)

James