Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Starting Strawberry in Win7

by LloydRice (Beadle)
on Aug 17, 2014 at 02:04 UTC ( [id://1097709]=perlquestion: print w/replies, xml ) Need Help??

LloydRice has asked for the wisdom of the Perl Monks concerning the following question:

I previously asked about file associations in Win8 using ActiveState. That one was solved.

Now it's back again. This is Win 7 Pro with Strawberry. A simple test script "test.pl" is one print statement.

print "This is a test\n";
assoc .pl .pl=Perl_program_file
ftype Perl_program_file Perl_program_file="\strawberry\perl\bin\perl.exe" "%1" %*

Issuing the command

test

Causes a window to pop up saying

Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access them.

I made sure all files had read/write permissions, including \strawberry. I tried running this from a DOS Box with and without admin privileges. That made no difference. I've had no problems with Win 7 Home Premium. This is my first time with Pro.

Also, I should note that ...

\strawberry\perl\bin\perl test.pl

works just fine.

Replies are listed 'Best First'.
Re: Starting Strawberry in Win7
by choroba (Cardinal) on Aug 17, 2014 at 07:21 UTC
    Maybe the drive letter is missing in the "full" path?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Starting Strawberry in Win7
by marto (Cardinal) on Aug 17, 2014 at 11:04 UTC
      It's perfectly valid to not specify the drive letter. \path\to\exe works just find, unless of course you happen to be on another drive than the one where \path\to\exe resides.
Re: Starting Strawberry in Win7 (PATHEXT)
by BrowserUk (Patriarch) on Aug 17, 2014 at 13:36 UTC

    What output do you get from:

    C:\test>set PATHEXT PATHEXT=.pl;.COM;.EXE;.BAT;.CMD;

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Starting Strawberry in Win7
by NetWallah (Canon) on Aug 17, 2014 at 18:20 UTC
    Also, check your Default Programs as advised in this node of Win7, ASSOCiation , and @ARGV.

    That thread details struggles with .pl association, and the way the OP fixed it.

            "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams

      With apologies to adefaria, it seems the drive letter IS required. Adding "C:" in front of the ftype string fixed it. choroba and marto, keep on truckin'. And thanks.

      And I should have included in my original question that I did have PATHEXT set up correctly. So, in reply to Laurent R, "test.pl" gave the same response as "test", both raised the "Windows cannot access..." popup, and then replied with "Access is denied", whether with admin privileges, or not. In reply to BrowserUK, I put the ".pl" farther down the string (just before ".BAT") instead of at the beginning, as in your note and as suggested in the "help ftype" printout. Apparently, order does not matter there.

      Many thanks to all. and to the Monks for a great site.

      Actually, there is one other note -- of Perl interest -- rather than Windows. I find it interesting that Strawberry set an appropriate ASSOC entry, but did not set anything in FTYPE. Is there a good reason for that?

        So, in reply to Laurent R, "test.pl" gave the same response as "test", both raised the "Windows cannot access..." popup, and then replied with "Access is denied", whether with admin privileges, or not.

        Maybe you still have the error, because there may be some other problems, but even if I use Perl under Windows only about 3 or 4 times per year (and am thus really not a specialist for that particular platform), I very much doubt that issuing the test command at the command prompt will launch the test.pl perl program.

Re: Starting Strawberry in Win7
by Laurent_R (Canon) on Aug 17, 2014 at 09:01 UTC
    Did you try to issue the following command:
    C:\Users\you>test.pl
    i.e. using the full name of your test script (without dropping the extension)?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1097709]
Approved by thomas895
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-19 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found