Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Command prompt q.

by jonabb (Novice)
on Jun 04, 2012 at 09:29 UTC ( #974253=perlquestion: print w/ replies, xml ) Need Help??
jonabb has asked for the wisdom of the Perl Monks concerning the following question:

Have just replaced my Vista laptop with a W7 laptop, and find I am unable to run Perl as before (I use it for one specific task which was set up for me by a friend)

The Command Processor shows the path "C:\windows/system32>", whereas with Vista it showed my user name

When I type a command under W7 I get the message 'Access is denied'

Any suggestions appreciated. thanks.

Jon

W7 64-bit; hard drive is configured with C drive for OS, D drive for Data

Comment on Command prompt q.
Re: Command prompt q.
by choroba (Abbot) on Jun 04, 2012 at 09:41 UTC
    What command do you type under W7?
    Have you installed Perl to the new laptop? Which one (Strawberry, ActivePerl...)?

      Thanks for responding

      The command I type is: "perl process2.pl *filename*.txt > *filename*.htm"

      I'm using perl to convert a text file to an htm file and to format it a certain way

      'process2.pl' is the file that contains the work done by my friend

      I have installed the latest version of ActivePerl

        Well, under cmd.exe that is an error, so what "Command Processor" are you using?

        perl process2.pl *filename*.txt > *filename*.htm
        You are using wildcards in the redirection part??????

        What happens if you leave out the redirection?

        Can you access perl.exe, and can you access process2.pl? Also make sure that your working directory is one where you have write permission.
        -- 
        Ronald Fischer <ynnor@mm.st>
Re: Command prompt q.
by Anonymous Monk on Jun 04, 2012 at 09:45 UTC

    When I type a command under W7 I get the message 'Access is denied'

    This isn't specific, basically its like saying it doesn't work -- sure it works, "access is denied" means you don't have the permission

    See perlrun and Behind the GUI lives the Shell and How Command Line Parameters Are Parsed

    I'm don't have W7 but I can't imagine starting programs from the shell works much differently from any other version of windows

    At a minimum, typing help at the command prompt should get you started on your journey

      "I can't imagine starting programs from the shell works much differently from any other version of windows "

      Imagine.

      M$'s "User Account Control"(s), UAC, create a good many new issues for users of Win7-- especially for Win7 users who seek to execute non-MS, non-mainstream (read: high market penetration), non-GUI programs and I have yet to find documentation of satisfactory, global workarounds. Yes, there are some reasonably effective ones, but so far, I've found most have to be applied at the retail level.

      Granted, I tend to be both iggerant and biased... so take the above as a possible starting point but not as gospel.

        Imagine ...

        I'm aware of UAC, not a big deal AFAIK, nothing much to do with argument parsing

Re: Command prompt q.
by poj (Priest) on Jun 04, 2012 at 11:30 UTC
    Click Windows Start on the task bar and type cmd in the "Search programs and files box" and press Enter. That should open a DOS window with the prompt C:\Users\yourname>
    Type perl -v to check your Perl is installed OK.
    Type dir process2.pl to check your program is there or dir to see all files.
    poj

      Thanks. Yes, I've now got the DOS window with the prompt you mention. So that resolves the issue I was faced with.

      However, when entering  perl -v I get the message  perl  is not recognised ... , so I guess I have not installed it correctly.

      Will retry installation and get back if still having difficulty.

      Must sign off for the night now (Hong Kong time)

      Thanks.

        However, when entering perl -v I get the message perl is not recognised ... , so I guess I have not installed it correctly.
        Not necessarily. It just means that inside *that* shell where you had tried the command, it's not in the PATH. What happens if you use the absolute path to perl.exe? I guess you *know* where you had it installed to?


        -- 
        Ronald Fischer <ynnor@mm.st>
Re: Command prompt q.
by MidLifeXis (Prior) on Jun 04, 2012 at 12:21 UTC

    If your command prompt shows "C:\windows/system32>" as you state, I would guess (and this is only a guess, given the information you have provided) that you are trying to create a file in the C:/windows/system32 directory. I would think (hope?) that this would be off limits to mortal users and require a privileged account to modify this directory.

    I would first find out why your command prompt is starting you in the system directory instead of in your home directory. I would not be surprised if your original problem would then just 'go away'.

    --MidLifeXis

      Thanks. Turns out I was not in the command prompt but something similar. Have now resolved that issue, thanks.

Re: Command prompt q.
by NetWallah (Abbot) on Jun 04, 2012 at 13:31 UTC
    Try entering the following command, before running perl:
    cd %USERPROFILE%
    The possible problem with that is that the files you expect to process may be in a different directory.

                 I hope life isn't a big joke, because I don't get it.
                       -SNL

      Thanks. I entered that code in the command prompt, but no result.

      Am signing off for the night now. Will follow up later.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-10-02 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (46 votes), past polls