First off I have fixed this problem. I am submitting this info here for others. I did a quick search and did not find anything like this here.
The Problem
One day I noticed a problem with commands not working in my Win2k Command prompt. After some checking I noticed that typing in 'path' an unresolved path was returned.
The History
A quick lesson for those who have no clue what I just said...
In WinNT type OSes there are several system environmental variables that are there for your convenience. You can view some...
echo %systemroot%
echo %homedrive%
echo %path%
You can view some in windows
Start->Settings->Control Panel->System->Advanced->Environmental Variables
The system variables are on the bottom.
These variables are used to make things simpler. Lets say for example that you want to execute a file that will always appear in the system32 directory of someone's computer, but you do not want/or cannot search for that directory. You could make a .bat file or script that references
%systemroot%\system32\notepad.exe (or whatever)
and this line will execute notepad (if it exists) on all WinNT-based OSes.
The path variable is known (to Windows) as
%systemroot%\system32;%systemroot%;%systemroot%\sy stem32\wbem
and when you type in 'path' or 'echo %path%' your OS will resolve (look up) these %name% variables to figure out what that means and print
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\ Wbem
my computer was printing
PATH=%systemroot%\system32;%systemroot%;%systemroo t%\system32\wbem
so my path was not set correctly and I could not find files that are obviously there (unless I manually add the correct options to my path).
The Culprit
Well all of these variables are located in you registry.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment
Some are of type REG_SZ and some are of the type REG_EXPAND_SZ. The path variable should be of type REG_EXPAND_SZ but it was of type REG_SZ. So it was not being expanded (resolved).
This was due to a HP printer install. For some reason the registry key type was changed.
The Fix
To the best of my knowledge you cannot change the type of path so you need to create a new value. And this can be accomplished without mucking around with regedit (actually you might not be able to properly fix it with regedit at all).
Go here
Start->Settings->Control Panel->System->Advanced->Environmental Variables
- Click on 'path' under system variables and select Edit.
- Highlight the entire path and copy.
- Click Cancel.
- Create a new variable and paste the path in (use the New button)
- Make the name unique (your initials maybe).
- Click Ok to set.
- Open up a command prompt to test.
- Type 'echo %thename%' if it returns the expanded version you are set
- Delete the 'path' variable by selecting it and clicking Delete
- Edit the unique variable and change the name to 'path'
- Click Ok until you are back at the Control Panel window
- Return to the command prompt to test.
- Type 'echo %path%' and you should have your expanded path
Banti
~~edit~~
Dang grammar