I\'ve got a Strawberry Perl program that accepts a single-file as a command-line argument. How can I set things up such that I can drag and drop the desired file onto the S
Here's another alternative to a "wrapper", but it requires a slight modification to the perl script:
@SETLOCAL ENABLEEXTENSIONS
@c:\path\to\perl.exe -x "%~f0" %*
@exit /b %ERRORLEVEL%
#!perl
#line 6
# ...perl script continues here...
The script is run like any other batch file. The first three lines basically invokes Perl on the CMD file itself (%~f0
, which only works if CMD extensions are turned on). The -x
paremeter to perl.exe tells Perl to skip everything until the #!perl
line. "#line 6
" just aids in debugging.
This is my preferred solution when I don't know much about the target system (and may not be able to edit the registry).