wpqs

There seems to be a bug in Windows 7 when setting the Environment Path Variable from Control Panel - System - Advanced System Settings - System Variables - select Path - click Edit - opens The Edit System Variable dialog box
The Edit System Variable dialog box displayed the same collection of path strings (each terminated by ';') as I get when I opened a command prompt window and type 'path'. However, it was not possible to add a new path string (c:\wills\bin;) after the last string. I presumed that the collection of path strings was too long so I removed a few of the path strings. Unfortunately, I still couldn't type my new path string.
BUG1: I would appear that length validation for text control in the Edit System Variable dialog box is not set to the same length as the max length for the collection of path strings.
BUG2: I was eventually able to enter my new path string after deleting some more path strings, but I hit further problems after saving my new path variable (press OK) as it seemed to delete some path strings at the start of the collection. For example %SystemRoot%\system32. Therefore, I was unable to reopen the dialog box from Control Panel.
Questions:
1. What is the maximum length of the Path variable?. Before I attempted to add my new path string there were 2014 characters in my path.
2. Some of the path strings include macros like "%SystemRoot%" which corresponds to "c:\windows". Does the maximum length of the path variable count the length of the macro (i.e. strlen("%SystemRoot%") or the length of what it contains (i.e. strlen("c:\windows")).
3. I suspect 2014 characters is longer than the max length of the Path variable. This suggests there is a bug in Windows Installer that allows installation programs to add strings to the Path variable without correct validation. Is that correct?
4. What other tools are available for setting the Path variable? Is there one that isn't riddled with bugs?
Wouldn't it be nice if there was an App that got round the limit on Path variable length by setting part of the Path variable according to the program you were using? For example, it might put %MyAppPath% in Path variable and then when a program is started substitute %MyAppPath% with the path string required by the program. Just a thought!
will stott