How to fix “not recognized as an internal or external command”

By | September 16, 2017

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 is the path variable to ping that is messed up.  I double checked that the 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.

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

I would recommend copying this value and pasting it on Notepad first before editing.  Save the old value as a text file so you will have a backup of the original value.

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

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 is entered.

Leave a Reply

Your email address will not be published. Required fields are marked *