File type actions for ruby scripts

Posted by Kovags on Super User See other posts from Super User or by Kovags
Published on 2011-03-17T15:26:13Z Indexed on 2011/03/17 16:12 UTC
Read the original article Hit count: 169

Filed under:

Hello,

I just installed the Ruby interpreter and created the file test.rb.

In the Folder Options, I created the rb file type and an action called Run and assigned the application C:\Ruby192\bin\ruby.exe "%1"" So It's possible for to get into the Windows XP command line and run the script simply by doing this:

C:\>test.rb

But when I need to send parameters to the script, I can't simply do the following:

C:>test.rb parameter1 parameter2

I'll have to do the following instead:

C:\Ruby192\bin\ruby.exe c:\test.rb parameter1 parameter2

I just noticed that I'm able to edit the action the following way to pass more parameters:

C:\Ruby192\bin\ruby.exe "%1" "%2" "%3""

That allows me to give 2 parameters to the script, but for some cases I need to pass a handful of parameters and it doesn't seem right for me to append "%5" "%6" "%7" ad nauseam.

What's the canonical way to do it?

© Super User or respective owner

Related posts about windows-xp