'ping' is not recognized as an internal or external command operable program or batch file error [duplicate]

When I type these:

ping yahoo.com 

or

ping -n or ipconfig

The answer is just this

'ping' is not recognized as an internal or external command operable program or batch file

or

'ipconfig' is not recognized as an internal or external command operable program or batch file.

i tried these 2 solutions.

Go to Properties in My computer, Advanced system settings → Advanced → Environment Variables Select 'PATH' from the list of system variables and edit and set PATH to c:\windows\system32 ; this will solve your problem.

If still you have a problem, do the below steps

Control Panel → System and security → Windows Firewall → Advanced settings → Inbound rules → New rule → custom rule

Im Protocol and ports: Protocol: ICMPv4 on the same panel go to customize, choose "Specific ICMP types", check the box "echo request"

but it is still a problem, how can I solve it?


When you updated your Path variable, did you close and then reopen the Command Prompt before you tried running those commands again? Because you need to (or possibly restart).

It sounds like your Path variable may have been overwritten by accident.

If you navigate to C:\WINDOWS\system32, and try to run ping from there, does it work? If so, it is your PATH variable that has the problem.


The path is now managed by Windows 7 and not the autoexec.bat or autoexec.nt files. To change the system environment variables, follow the below steps.

From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.

This is the default PATH environment variable setting on fresh install of Windows 7

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\