If you are getting frustrating error messages or no response at all while trying to execute commands in the Windows 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 dive deep into the common reasons why commands may not work as expected or the Command Prompt is not recognizing 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, for some reason, 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.
ipconfig, but any of the Windows Command Prompt commands also didn’t work at all and I got the same error message.
Fixing the Command Prompt not Opening Issue
In this troubleshooting guide, we’re going to offer practical solutions that will have your Command Prompt up and running 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 are unable to 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 simply 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 on the file and select the Run as administrator option from the context menu. to launch CMD with admin privileges.
If the File Explorer method didn’t work for you try the next method.
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 on 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 then clock on the OK button. The Command Prompt window should open.
Alternatively, you can also open the Command Prompt as an administrator by holding the Ctrl key while clicking the File> Run new task option.
If you couldn’t make the CMD window launch via the Task Manager, don’t forget to check out our tutorial describing 18 ways to open the Command Prompt in Windows 10 and 11.
3. Run SFC Scan via PowerShell
Running an SFC (System File Checker) scan via 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 it 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. If you don’t know how to do that, here are 17 ways to open Windows PowerShell.
- When the PowerShell window pops up, simply type the following command and press the Enter key.
- 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. Perform a System Restore
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 on 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 on the Next button.
When your PC is restored, try running the Command Prompt. If you are still unable to 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 are not able to 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 on 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 on 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 to
C:\Technastic\platform-toolsand that’s why I was unable to execute any command in the Command Prompt. In some cases, the path variable might be missing.
- If the path variable is missing, click on the New… button located below the System variables pane. In case the value of the path variable is different 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
- Then click on the OK button to save your changes. You’ll need to click on OK in the Environment Variables window and also on 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
ipconfigand other commands normally.
The above fix should solve the command not working in the Command Prompt on your Windows PC. However, if you 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, then it may be necessary to reinstall or repair Windows itself. With these tips in hand, hopefully, anyone experiencing this problem will be able to get their Command Prompt working properly again.
Read Next: 250+ Keyboard Shortcuts for Windows 10/11