Windows Enterprise Desktop

Dec 4 2009   6:25PM GMT

Handy Tool Simplifies Editing Windows Path Variable

Ed Tittel Ed Tittel Profile: Ed Tittel

As I work with Windows from day to day, I often find myself looking at the way things work inside that OS and wondering why some things can’t be improved. Recently, I’ve tech-edited a book on the Python-based Django Web development environment and have been digging into the Windows Preinstallation Environment and the Windows Automated Installation Kit (aka WAIK or Windows AIK). Both of these projects have required me to edit the Windows path variable, which defines an ordered list of directory specifications that Windows searches when you tell it to find something. In short, this is the capability that lets you enter cmd.exe into the Search box in Vista or Windows 7, and that resolves that request into C:\Windows\System32\cmd.exe which is the actual complete specification for that file.

Alas, editing the path variable in the default Windows environment remains a bit irksome. You can do it at the command line, using syntax like path = %path%;C:\Example to add a directory spec at the end of the path, or by reassigning an entirely new path value when you want to change the search order. Or, you can click the Windows logo and Break keys at the same time to launch the System window, and then do the following:

  1. Click on Advanced System Settings in the task area at the upper left of the System window to launch System Properties.
  2. Click the Environment Variables button at the bottom right of the System Properties window to open the Environment Variables window.
  3. Scroll down in either the User or System variables panes inside the Environment Variables window until you see the path entry, then click Edit.
  4. This opens an Edit System Variable or Edit User Variable button, where you can inspect and edit the value for that variable in the Variable value: textbox therein, as shown here:
The textbox is small, but the value is large

The textbox is small, but the value is large

The problem, of course, is that it’s not unusual for a path variable to get pretty large in Windows (mine is currently 257 characters long, and I’ve seen longer) but the textbox area for display accommodates only around 40 characters. That makes scrolling back and forth inside that box something of a pain. I won’t bother to complain about the vagaries of editing the value at the command line, because the best way to do that already does so eloquently: run cmd.exe, type set at the command line, use multiple inline editing commands to grab the path variable value, paste it into a text editor for manipulation, then reverse the process to reassign its value.

Fortunately, there is a much better way to do this. Freeware called Redmond Path from Redmond Lab .Net is available to improve and simplify editing path variable values. A single screenshot tells the whole story here.

Redmond Path visualizes path variable values nicely

Redmond Path visualizes path variable values nicely

Click the plus sign to create a new value, or highlight and click the red X to remove an existing value. Highlight a value, then use the up and down arrows to change its place in the search order. All values appear in order as individual entries in a vertical list and can be managed as such.

Simple. Easy. Effective. Free. Why doesn’t Microsoft do it that way?

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: