Office Hours 5: Environment variables

Robert Hallock (Thrax)

October 22, 2008 12:30 PM ET in Articles, Column, , , , , , , , , , , ,

Icrontic is proud to offer the Office Hours series of articles. Each week we’ll take a look at a common problem in Windows or often-used software and nail down a quick fix for it. This week the good doctor explores DOS commands that are reported as invalid internal or external commands.

The Problem

It is evident that one of Windows XP’s most potent tools in troubleshooting errors is the DOS shell. The sheer volume of support threads that call for users to perform pings, tracerts or ipconfigs from the anachronistic interface speaks of its institutionalization. What if these commands stopped working?

Today we’ll be covering the common issue of a broken %PATH% environment variable, which cripples the ability to use these small utilities we’ve taken for granted. The primary symptom is presented with a shell command, like ping or netstat, that is “not recognized as an internal or external command.” A possible secondary symptom can be the inability to launch familiar applications like msconfig or regedit.

The Fix

These commands are not just commands, but actual applications buried deep within Windows XP’s many system files. They can be run so conveniently from the command line or run box thanks to the %PATH% environment variable which specifies three or more critical folders in Windows XP:

  • C:\Windows\System32\
  • C:\Windows\
  • C:\Windows\System32\Wbem

Without these directories, we would have to type C:\Windows\System32\ping.exe just to perform the ubiquitous ping.

While there are many programs capable of adding to this %PATH% variable without issue, some can inadvertently break it. Thankfully, all it takes is a little copying and pasting to get the system back in working order.

Step 1:

The Windows XP System Properties menu.

The Windows XP System Properties menu.

Find the My Computer icon located on your desktop or in the start menu. Right click on the icon and hit properties to display the Windows XP System Properties menu.

Step 2:

Navigate over to the Advanced tab and notice a button at the bottom entitled Environment Variables. Pressing that button will display the Windows XP Environment Variables configuration interface.

Step 3:

The lower of the two panes in the environment variables menu — titled System variables — contains a line called “path.” Double click on that line to edit the %PATH% variable’s contents.

Step 4:

Now that we’re in the %PATH% variable, there could be any number of folders specified here. While you’ll want to leave existing entries alone, assure that the following text is specified exactly as shown at the beginning of the string:

C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;

Also be sure to verify that a semicolon is in place to separate each folder or the %PATH% variable will continue to be corrupted.

A default %PATH% variable for Windows XP.

Post-mortem

Now that you’ve reset the %PATH% to include the default entries for Windows XP, press “ok” on all open dialogs to exit out of them and return to the desktop. Secondly, make sure you restart your PC to force the changes into effect.

What once was broken, is now fixed! Those shell utilities and applications launched from the run box should resume their normal operation.

Do you have a common Windows or software irritation for the good doctor? Send an email to robert@icrontic.com to see if there’s a quick fix for what ails you. The best ailments will be featured every Wednesday right here on Icrontic.

0 Comments

Troll-free since 2003 ®