Probably not very helpful, but one thing I noticed is that in the output on the XP/2000 systems, the subdir C:\cygwin magically appears appended to the post-GetOptions list?

Are you running cygwin on these systems?

Not having a XP/2000 system to hand, I don't know which path through early (batch) code these system take. Ie, do they take the :WinNT path or not?

The different treatment of the parameters (batch) between the 2 paths might have something to do with this?

Ie.

perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9

versus

:WinNT perl -x -S %0 %*

Maybe a read herring, but it might be interesting to try using the long form for NT and see if that makes a difference?

Update Looking into this a little further, I added a line @echo %1 %2 %3 ..., as the third line of your .bat/.pl, you'll find that when you drag/drop onto the shortcut, under NT at least, the script doesn't receive any of the command line parameters at all!

Essentially, the reason is that the filespecs droppped are passed through to the shortcut using DDE, and the command line parameters are essentially ignored. Obviously not very useful and something (on the basis of your evidence) that MS has corrected in NT5 and later.

The bottom line here is that this is neither a Perl (the language) bug nor a perl (AS) implementation error. It is simply a bug (that is never going to be fixed) in NT4/W95.

As such, it therefore falls beyond the scope of interest for this forum.

As for a work-around. When you code the parameters into the shortcut, they are essentially becoming hard-coded defaults to the script. So, the easiest way to do this would be to hardcode them somewhere else.

Possibilities include:


In reply to Re: Getopts with NT4 and Win9x shortcuts by BrowserUk
in thread Getopts with NT4 and Win9x shortcuts by mkmcconn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.