[Windows XP] File Associations + Command Line arguments

Shovel

Part of the furniture
Joined
Dec 22, 2003
Messages
1,350
Fairly simple one I hope.

I run Perl on my system for uber scripting purposes (I haven't got around to learning vbs), and for ages have just had ".pl" associated with Perl.exe. Today I wrote a script that actually takes command line arguments and discovered a problem. Through the association, the command line arguments don't get passed on.

If, alternatively, I run: "perl myscript.pl rah!" it will work though.

Does anyone know how to set up a file association that will pass on the command args automagically? Thank you :)
 

Shovel

Part of the furniture
Joined
Dec 22, 2003
Messages
1,350
Heh: Fixed already. I looked up the settings for .vbs files and copied it from there.

For reference then, the application assicated with my "Run" (or "Open") action now looks like:
Code:
E:\Win\Perl\bin\perl.exe "%1" %*
The %1 refers to the file name of the script, while the %* (which I was originally missing) is critical as it passes on all additional command line args.
 

Shovel

Part of the furniture
Joined
Dec 22, 2003
Messages
1,350
I came across another little addition for this today.

If you add ".pl;" to your PATHEXT environment variable you can launch Perl scripts without adding the .pl extension at the prompt.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom