If you are getting error messages or no response while trying to execute commands in the Command Prompt, it could be due to several reasons. In this tutorial, we’ll check out the solutions to fix the commands not working issue in Command Prompt in Windows 10 and 11. We’ll explore the common reasons why commands don’t work as expected or the Command Prompt doesn’t recognize commands and provide practical solutions to make things work for you.
The idea to write this guide occurred to me from a personal experience. Windows PowerShell commands worked normally on my PC but the commands I issued returned errors saying the Command Prompt does not recognize commands.
'ipconfig' is not recognized as an internal or external command, operable program or batch file.
Not just ipconfig
, but any of the Windows Command Prompt commands also didn’t work and I got the same error message.
Fixing the Command Prompt not Opening Issue
This troubleshooting guide will offer practical solutions to make the Command Prompt run smoothly. Let’s get started!
1. Open the Command Prompt from CMD Executable
There are several ways to open the Command Prompt. However, if you can’t launch it from the Windows Start menu, you can try other ways.
- Open the File Explorer on your PC.
- Navigate to C:\Windows\System32 or C:\Windows\SysWOW64\. You can paste one of these paths into the File Explorer’s address bar and hit the Enter key.
- Look for cmd.exe in the System32 directory.
- Right-click the file and select the Run as administrator option from the context menu to launch CMD with admin privileges.
If the File Explorer method doesn’t work for you, try the next one.
2. Launch CMD from Task Manager with Admin Privileges
There are 2 ways to launch the Command Prompt as an administrator in Windows 10 and 11 via the Task Manager.
- Open the Task Manager using the Ctrl + Shift + Esc keyboard shortcut.
- Click File > Run new task.
- A new pop-up window entitled Create new task will appear.
- Type ‘cmd’ in the text area, select the Create this task with administrative privileges option, and click the OK button. The Command Prompt window should open.
Alternatively, you can open the Command Prompt as an administrator by holding the Ctrl key while clicking the File> Run new task option.
3. Run SFC Scan via PowerShell
Running an SFC (System File Checker) scan in PowerShell is an efficient method to ensure the integrity and stability of the Windows operating system. SFC scan safeguards against potential software failures, unexpected crashes, application malfunctions, or even security vulnerabilities arising from compromised system files.
If the Command Prompt is not opening on your PC or opens and closes immediately in Windows 11 or 10, it may be due to corrupted or missing system files. You can perform an SFC scan to repair those files. This method can also help if the Command Prompt is not showing the output when you run a command,
- Launch PowerShell as an administrator.
- When the PowerShell window pops up, type the following command and press the Enter key.
sfc /scannow
- The command will identify and repair corrupted or missing system files. When the scan is complete, close PowerShell and try opening the Command Prompt.
4. Create a System Restore Point
Since I keep testing things on my Windows PC, I sometimes run into trouble, and in that case, performing a system restore is my first resort. If you remember creating a system restore point when the Command Prompt was working fine on your computer, you can restore all settings and undo the recent changes to your computer.
- Type “create a restore point” in the search box located in the Windows Start menu or the taskbar. Click on Create a restore point.
- Then click the System Restore > Next button.
- You’ll now have the list of all the system restore points you created. Select the restore point and click the Next button.
When your PC is restored, try running the Command Prompt. If you cannot open and use the Command Prompt, try the next potential fix to resolve the issue.
Fixing Command Prompt not Working Error
If the Command Prompt is opening normally for you but you can’t execute any command, try the following solution.
Edit Path System Environment Variable
If the Command Prompt commands are not working for you and you get the command not recognized error, it may be due to a path variable missing in your computer. Once you add that variable, the Windows Command Prompt will start working again. Here is how to change or edit the environment variables.
- Click the Windows icon to open the Start Menu.
- Type “advanced system settings” in the search field and select View advanced system settings.
- The System Properties window will pop up. Click the Environment Variables button.
- A new window showing the list of all existing variables will appear.
- Look for the Path variable extry under the System variables pane. Make sure that the value of Path is
C:\windows\system32
. In my case, it was set toC:\Technastic\platform-tools
and that’s why I could not execute any command in the Command Prompt. In some cases, the path variable might be missing. - If the path variable is missing, click the New… button below the System variables pane. In case the value of the path variable differs from the one mentioned above, select the Edit… button instead.
- A new window will pop up that will let you create or edit a system variable. Set the variable name to ‘Path‘ and the variable value to
%systemroot%\system32
,C:\windows\syswow64\
, orC:\windows\system32
. - Then click the OK button to save your changes. Also, click OK in the Environment Variables and the System Properties window.
- Restart your Windows PC, launch the Command Prompt, and try executing any command. The Command Prompt should work fine now! Having made the above changes in the path variable, I was able to use the
ipconfig
and other commands normally.
The above fix should solve the command not working in the Command Prompt on your Windows PC. However, if you are still grappling with the problem, you might need to try the following solutions in the order they are mentioned.
- Update Windows
- Disable your antivirus program.
- Create a New User Account.
- Boot your PC in Safe Mode and run the Command Prompt.
- Reset your Windows PC.
- Re-install Windows on your PC.
From updating Windows and antivirus software to running SFC scans and restarting your computer, chances are that one of these solutions will help solve the issue. If all else fails, it may be necessary to reinstall or repair Windows itself.
Read Next: 250+ Keyboard Shortcuts for Windows 10/11