Sorry about that improper wordings.
Actually C:\perl\bin is added to PATH. Here is the result of "set path"
"C:\perlfiles>set path
PATH=C:\Perl\bin;C:\Program Files\java\jdk1.6.0_11\jre\bin;C:\Program Files\DivX
\DivX Player\DivX Player.exe;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
Question is when cmd.exe is already set in environment variable "ComSpec", why is it not found by "perldoc" ? Is it supposed to be set in any other environment variable ?
If thats the case, then whenever any program is using cmd.exe, it will give the same error, right ?
| [reply] |
Question is when cmd.exe is already set in environment variable "ComSpec", why is it not found by "perldoc" ?
Because "cmd.exe" is only the local name of the file. All versions of the Microsoft file systems also need to know which directory "cmd.exe" resides in. That is the function of %PATH%: to list all the directories where the OS should look when it has only the local name.
The value of %PATH% you show appears to be missing the directory where cmd.exe is located. For example, in Vista cmd.exe is located in the C:\Windows\System32 directory. I think this is also true for all of the 32 bit versions of Windows (e.g. 95, 2000, XP), but others can verify this.
The long ugly list of directories that the first few posters said needed to be in PATH are also missing from you %PATH%. They hold not only cmd.exe but several system libraries (DLLs). Many compiled programs only have the local name of the libraries they want and so the MS OSes rely on PATH to find the directory where those libraries are located.
Paths are searched in the same order they are listed so you'll also want those directories to be the first one's on the path. Otherwise, the OS might find first (and use) a program that just happens to be named "cmd.exe" that isn't the one provided by the OS. Once you've added these directories to your path, things should probably work OK.
It may not make sense that Windows doesn't just "know" where these things are located, but that's the way it is.
Best, beth
| [reply] [d/l] [select] |