in reply to Hiding the DOS window..

Thanks to the person who suggested EXETYPE as the solution to my problem. That solved the problem perfectly.

But in testing, I discovered a new wrinkle.

I set Window's associations so that the extension .pl is matched to wperl, it calls wperl.exe and runs the script. If I set it to associate Perl.exe, it also runs perfectly, but with the dos box. So far so good.

If I call the wperl interpreter from Win2k's DOS commandline, it all works perfectly. But when the big commercial program makes the exact same call using it's "run program" operation, the commandline parameters are lost. But when I set the associations back to perl.exe, the commandline parameters are passed properly. Yet when called from the DOS commandline, the cmdline params are passed properly both to perl and wperl.

Any ideas why?

Thanks, Nat

Replies are listed 'Best First'.
Re: More on Hiding DOS Windows
by jonadab (Parson) on Feb 20, 2005 at 13:53 UTC

    Is there a slight difference in how the registry associations are set up in the two cases, e.g., in what is quoted and what isn't? It's been a couple of years since I used Windows enough to mess with registry assocations, so the details are fuzzy in my mind, but ISTR that sometimes little easy-to-miss things like whether the %1 was inside the same quotes as the filepath or a separate set of quotes could make a big difference. Also you don't mention what happens if you double-click a .pl file in explorer.exe; that might help diagnose whether the problem has more to do with the association itself (more likely) or the way the big commercial program is handling it (also possible).


    "In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68
      The "big commercial program" (BCP) masks how it handles it, so I don't know exactly what it is doing. BUT, if I set up the call as "Run Program" "\Perl\bin\wperl.exe" with parameters of "Perlscript.pl" "Parameters", it works perfectly. If instead, I make it "Run Program" "Perlscript.pl" "Parameters" the parameters are lost when file associations are set to call wperl for .pl extensions, whereas if the associations are set for perl.exe, the parameters are not lost.

      It may be that I will have to change every call to the first format. That might be acceptable, but it will mean a lot of work going thru the massive data set and locating every place a Perl script has been inserted. I don't even mind the work, it's the mistakes I will make doing it, plus the fact that when reviewing the data for troubleshooting purposes BCP hides the actual parameters. Thus I cannot easily tell at any point what Perl script is being invoked if I make these changes. Annoying.

      Looking at the registry, I don't really see any difference in how they are set up. To change the associations I just right-click on a .pl file and select open with... Choose program... and select Perl.exe or Wperl.exe. It seems pretty transparant, but I am tripping over this silly little anomaly.

      Thanks for the help. Any additional suggestions are most welcome.

      Nat

        To change the associations I just right-click on a .pl file and select open with... Choose program... and select Perl.exe or Wperl.exe.

        I am totally guessing here, but this might be related to your problem. That method of setting up associations does not expose all the details to you. You might ought to look under View->Folder Options->File Types to see the details of how the file association is set up. It is quite possible that the association is not getting set up 100% correctly. If you've never worked with the File Types settings before, consult your local Windows guru.


        "In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68

        It sounds like BCP is not passing the parameters correctly. Either fix the association of .pl files to use wperl or try "Run Program" "\Perl\bin\wperl.exe" "Perlscript.pl Parameters".

Re: More on Hiding DOS Windows
by chanio (Priest) on Feb 21, 2005 at 03:40 UTC
    If I were you, I would re-install ActivePerl.-

    Then, just create a batch file to call wperl, like this...

    @echo off REM [callwperl.bat] Just call wperl with the params c:\perl\bin\wperl %*

    ... And call it with the params instead of the other thing.

    You shouldn't be changing those messy extensions without knowing. It should be done through the 'folders extensions' and then at the .pl extension add "%1" next to wperl.exe.