»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 03-12-2004, 08:57 AM   #1 (permalink)
Registered User
 
Banti's Avatar
 
Join Date: Oct 2001
Location: Alpharetta, GA
Posts: 1,143
Banti is on a distinguished road
Send a message via Yahoo to Banti
Path Resolution Issues (for info only)

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


Last edited by Banti; 03-12-2004 at 09:04 AM.
Banti is offline   Reply With Quote
Old 03-12-2004, 09:07 AM   #2 (permalink)
Registered User
 
Scott Tiger's Avatar
 
Join Date: Mar 2002
Location: Roanoke, VA
Posts: 3,379
Scott Tiger is on a distinguished road
Thanks listing your fix. I'm sure someone will benefit from your post.
__________________
Registered Linux User: 288411
Licensed Windows XP User
Scott Tiger is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 02:04 PM.