Solved: unrecognized external command error in command window
- From: FUBARinSFO <file1303@xxxxxxxxx>
- Date: Sat, 23 Jun 2007 22:15:04 -0000
PROBLEM
Error in command window:
'<command>' not recognized as an internal or external command,
operable program or batch program.
where <command> is any external command such as ping, xcopy, diskcopy,
diskcomp, format, etc.
SOLUTION
There are two solutions
1. Manual registry fix
Fix registry entry for Path variable from REG_SZ to REG_SZ_EXPAND in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
\Environment
2. Identify and repair/uninstall/upgrade program that caused the
problem
In this case the problem was caused by Diskeeper 2007 Professional
Premier v11.0.706.0. Rolling back prior installs/uninstall identified
it as the cause (the correct registry entry for Path was restored),
and an upgrade to 11.0.709.0 using a download of the trial .709t
version corrected the bad registry entry.
DISCUSSION
The Path registry entry has its data value a string that starts like
this:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;...
The path element %SyatemRoot% has to be expanded by Windows to yield
the directory in which Windows is installed (in this case 'C:
\WINDOWS'). The data type of the Path varible is REG_EXPAND_SZ, so it
is tagged as requiring expansion before use. the Path in a command
window will then be a proper path, starting with
C:WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;...
Otherwise, without expansion, it will be the literal string above:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;...
The unexpanded string will be unintellible to the command interpreter,
causing attempts to locate external commands to fail.
In the instant case, the installation program of Diskeeper changed the
data type of the Path variable from REG_EXPAND_SZ to REG_SZ when it
substituted its own string with a pointer to its program in the
path.
The path was fixed by either 1) renaming the old path variable to
path_old and creating a new path variable of the correct data type, or
2) installing a slighltly later version of the program over the
existing program, which had the correct code for the path variable.
FURTHER INFORMATION
This problem and its (manual) solution has been noted in several other
posts from time to time. Wesley Vogel posts here and see for example
Bill Stewart's post at
http://internet.cybermesa.com/~bstewart/cmdprompt.html#6
Why don't my commands work?
In some cases, the actual contents of the environment variable is
correct, but the registry data type is incorrect. The system registry
environment variable type should be REG_EXPAND_SZ, not REG_SZ.
There are presumably other instances of this problem (e.g.%UserProfile
%) in which the data type is incorrect for the expansion of the
variables. But for the most part the notes in the past do not seem to
reflect the identification of the programs responsible for the error.
Here, it was possible to identify the program by uninstalling programs
and then inspecting the resulting path string in a command window. In
other cases positive identification of the source of the error may
require a clean install with various system restore points to identify
the offending application.
-- Roy Zider
.
- Prev by Date: Re: defrag hard drive
- Next by Date: Re: Display text fragments
- Previous by thread: Free Offers
- Next by thread: Re: Cannot create toolbar.
- Index(es):
Relevant Pages
|