Cmd.exe doesn't work when opened through Windows search bar


  1. Posts : 2
    Windows 7 Professional 64bit
       #1

    Cmd.exe doesn't work when opened through Windows search bar


    This is probably something that has a really simple fix, but I have no idea why it's happening. When i type cmd.exe into the Windows search bar and open it, everything I type in (like ipconfig) doesn't work, and it gives me the message "'ipconfig' is not recognized as an internal or external command, operable program or batch file." It should also be noted that the command line that I'm typing into says: C:\Users\Grant>

    On the other hand, if I search cmd.exe, right click on it, click on Open file location and then double click cmd.exe in the System32 folder, it will open and if I type in things like ipconfig it will work just fine. The command line this time says: C:\Windows\System32>

    Why is it that I can't just open it up the short way and do it?
      My Computer


  2. whs
    Posts : 26,210
    Vista, Windows7, Mint Mate, Zorin, Windows 8
       #2

    You have to run as admin
    Attached Thumbnails Attached Thumbnails Cmd.exe doesn't work when opened through Windows search bar-2016-04-13_1608.png  
      My Computer


  3. Posts : 2
    Windows 7 Professional 64bit
    Thread Starter
       #3

    The profile I'm logged in under is the administrator. Why do I have to choose to run it as the administrator? Shouldn't the computer know that already?
      My Computer


  4. Posts : 8
    Windows 7
       #4

    Does your PATH variable include C:\WINDOWS\SYSTEM32 or the equivalent path to your O/S installation?

    Kevin
      My Computer


  5. whs
    Posts : 26,210
    Vista, Windows7, Mint Mate, Zorin, Windows 8
       #5

    Schw1341 said:
    The profile I'm logged in under is the administrator. Why do I have to choose to run it as the administrator? Shouldn't the computer know that already?
    You are not THAT admin. Just do as I suggested.
      My Computer


  6. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #6

    Hi Schw1341,

    As Kkehoe has caught on, your PATH environment variable may be missing or damaged.

    In an Elevated Command Prompt, run the below command. Then open a new CMD instance, and try Ipconfig.
    Code:
    setx /m Path "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\\"
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:16.
Find Us