Windows – CMD.EXE and PATH

windows 7

I recently had to test connectivity with another computer on my home network. As I had always done, I launched CMD.EXE and a black, familiar window is opened, with a title saying that I am the Administrator (wow!). I type PING followed by the URL, and it says that PING is not a recognized command. I make a quick search for PING.EXE, and it is in Windows/System32. I then repeat the command using the full path, and it works. It happens that System32 is not in the PATH of the shell.

How did it get removed from the path, and how should I put it back?

Best Answer

You can make it work by following these steps:

  1. Right-click on Computer > Select Properties
  2. In System Properties click the Advanced tab > Click Environment Variables... button
  3. Under System variables scroll down to Path and double click it
  4. Click on the Variable value text field and move the cursor to the front
  5. Paste this: %SystemRoot%\system32;
  6. Click Okay to close the open dialogs, and restart if necessary.

The Path environmental variable allows you to type program names from any directory. Windows will check the directories listed there if it can't find the command in the current directory.

Related Question