There are cases when software installers mess up our Windows environment variables. When the environment variables get messed up, it could lead to trouble with other programs that share the same environment variable. One such symptom is the following error in Windows:

"command" is not recognized as an internal or external command, operable program or batch file.


This happened to me when I was trying to run ping from the command line. Suddenly it throws me the same error as above. I know for sure that I could not have deleted the ping executable file, so I suspected that it was the PATH variable to ping that got messed up. I even double checked to make sure that ping.exe exists in the WINDOWS\system32 folder.

To access the environment variables, right click the My Computer icon then choose Properties. Select the Advanced tab and then click Environment Variables. In newer versions of Windows, click on the Advanced System Settings link.

At the system variables panel, choose Path then click the Edit button.

I would recommend copying the values and pasting them into Notepad first before editing. Save the old values as a text file so you will have a backup of the original values.

Edit the variable value. It is a long string separated by semicolons. Make sure the executable file’s location is one of the entries in this string.  If it is not, enter the location of the executable file’s parent folder.

Note that in Windows 10, the values are presented in a table format, which makes it a bit easier to read. If you prefer, you can click Edit Text to see all the values in one text box.

Click OK after editing the value.  Reboot the computer to enable the new value. After rebooting, try executing the command again and verify that it fixed your problem. If it doesn’t, double check the value of the path variable again. It could be a bad syntax with the semicolons or a wrong value was entered.