Path Variable Setting - Max Length Exceeded
Sunday, April 08, 2012 12:45 PM wpqs wpqs 0 Points300 Recent Achievements First Helpful VoteFirst Marked AnswerFirst Forums Reply wpqs's threadsView Profile 0 Points 0 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
April 9th, 2012 8:59am

"wpqs" wrote 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. https://msmvps.com/blogs/erikr/archive/2007/09/17/maximum-length-of-environment-variables-windows.aspx may help :) Noel Paton | Nil Carborundum Illegitemi | CrashFixPC | The Three-toed Sloth
Free Windows Admin Tool Kit Click here and download it now
April 9th, 2012 9:44am

Hi, please check the following KB if can help. http://search.microsoft.com/en-US/results.aspx?q=2685893&x=9&y=19 Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
April 13th, 2012 12:34pm

Hi, i am just check if you have any updates for that?Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
April 19th, 2012 11:11am

Hi, I'm sorry, but the link you suggested doesn't really address my problem. Will will stott
April 30th, 2012 4:41am

Hi, I'm sorry, but the link you suggested doesn't really address my problem. Willwill stott
Free Windows Admin Tool Kit Click here and download it now
April 30th, 2012 4:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics