Windows – Win 7 Command prompt does’t use PATH to find executables

command linepathwindows 7

The command prompt cannot find such common commands as ping, ipconfig etc until I navigate to system32. But the PATH variable contains %SystemRoot%\System32\.

What could be a problem?

Best Answer

If you're sure that the contents of PATH variable are correct, then check the registry:

  1. Open regedit.exe
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
  3. What's the type of "Path" registry key? If it's not not REG_EXPAND_SZ then this could be the problem.
  4. You can change it to REG_EXPAND_SZ by doing this:

      * Double Click “Path” and copy it’s Data Value “…%SystemRoot%system32;%SystemRoot%; …”
      * Delete the “Path”
      * Create New > Expandable String Value
      * Give “Path” as the name, double click it, and Paste the value copied in the previous step to the “Value Data” field
    
  5. Close the Regedit window and restart
Related Question