Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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.


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

Replies are listed 'Best First'.
Re: Command prompt q.
by MidLifeXis (Monsignor) 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'.


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

Re: Command prompt q.
by poj (Monsignor) 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 to check your program is there or dir to see all files.

      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)


        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 <>
Re: Command prompt q.
by choroba (Bishop) 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 *filename*.txt > *filename*.htm"

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

      '' is the file that contains the work done by my friend

      I have installed the latest version of ActivePerl

        perl *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 Also make sure that your working directory is one where you have write permission.
        Ronald Fischer <>

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

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 "


      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 NetWallah (Canon) on Jun 04, 2012 at 13:31 UTC
    Try entering the following command, before running perl:
    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.

      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://974253]
Approved by BrowserUk
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-04-24 01:36 GMT
Find Nodes?
    Voting Booth?