Fix Command Prompt opens and closes immediately Windows 11.
Microsoft is trying to make Windows 11 a completely clean operating system, but bugs always seem to outdo it. One of the problems is Command Prompt crashes on Windows 11. Native apps show up randomly and crash when you are dealing with some other apps. Otherwise, when you go exclusively to the command prompt in Windows 11, it opens but becomes unresponsive and then crashes
Curiously, users who have reported such errors have also mentioned that at other times the command prompt works quite smoothly. In this tutorial, Ngolongtech will mention some possible reasons that can cause the error. Also, Ngolongtech will list troubleshooting methods that can help you to fix the command prompt hang on Windows 11.
Why does Command Prompt open and close immediately on Windows 11
- The system files on the device are corrupted.
- There may be a bug on the current build of Windows 11 installed on your PC.
- It can happen due to the presence of some malware on the computer.
- An environment variable is missing from the path that is normally assigned to the open command prompt.
- Command prompt on Windows 11 crashed due to auto-running cryptomining key.
1. Restart the computer
You should restart your PC as it could be a minor software issue causing the command prompt to get messed up.
- Type in Windows .
- From the dialog that pops up, click the power icon.
- Then click Restart from the menu that appears.
In most of the cases, users have reported that only restarting their computer solved the Windows 11 command prompt problem.
2. Update Windows OS build
Errors still haunt the Windows OS despite its upgrade to Windows 11. Microsoft regularly releases updates to fix bugs that render various applications and services useless on computers.
To search for new updates available for your computer,
- Press Windows + I to open Windows settings.
- Then click on Windows Update.
- Next, click Check for Updates.
- If a new update is available, you will be prompted to download and install the same.
- To install a Windows update, click Download Now next to the update description.
After updating, check if you still get the command prompt error on your Windows 11 computer.
3. Remove Cryptocurrency Mining Auto Key
Cryptocurrency mining is the new fad but it also brings a lot of malware. One of them is called SoundMixer. It is an autorun key that messes with the registry and makes unauthorized modifications.
This is the cause of the command prompt not working on Windows 11. However, this problem can be fixed.
- Open Registry Editor by calling the run dialog Win + R .
- Then navigate to the menu bar and click Edit .
- From the drop-down menu, click Find.
- In the Find field, enter SOUND MIXES.[ make sure the three options are checked ]
- Two things will happen right now. The search results will either find a key that automatically runs SOUNDMIXER or it won’t.
- Luckily, on my PC I didn’t find SOUNDMIXER even after searching many times.
- In case, you find the folder SOUNDMIXER is located after performing the find action, then open that folder in the registry itself.
- When you expand it, you will see an autorun registry entry. Simply delete it.
- Just to confirm, you can repeat the steps above to check if SOUNDMIXER has found its way into other locations.
Note that the autorun key may appear randomly. Only by using the Find action can you locate it.
As a pro tip, I would suggest that if you are learning about cryptocurrency mining make sure your computer is free of malware. Timely run a full Windows Defender scan or use any other third-party antivirus you have installed on your PC.
4. Repair Corrupt System Files
There are certain system files that, when corrupted, affect the way other applications work on the computer.
- if you can access the command prompt through Administrator privileges, look for command prompt in Windows search.
- Click Run As Administrator .
- Enter the command sfc/scannow .
- Press enter and the system will start searching for corrupted system files. Wait while Windows will fix these files.
After the process is finished, make sure to restart the computer and then access cmd as user. It should be cured now.
5. Scan for Malware with Windows Defender
Malware problems have always been rampant on the Windows operating system. If you browse through lots of websites, install dozens of apps, chances are some stubborn malware has infiltrated your computer. Its presence causes the command prompt to become unresponsive or crash unexpectedly.
So you have to use Windows Defender to manually scan your computer.
- Press Windows + I to bring up the Windows Settings section.
- Then click on Privacy & Security .
- Then click Windows Security.
- Next, click on Virus & Threat Protection.
- You can click Quick Scan or perform a full scan to look for malware in your hard drive.
If any malware is found, remove it. Now, you will not face any problem while running command prompt.
6. Environment Variables Integration Missing
Some of you may have encountered the problem of the command prompt opening continuously and crashing in quick succession. This happens because of a missing variable in the command prompt opening path. Integrate Missing Environment Variables into Command Prompt’s Path for manual troubleshooting.
- Press Windows + R to invoke the run dialog.
- Open System Properties by typing sysdm.cpl and press enter key.
- Click Advanced and navigate to the bottom of the dialog box.
- Then click on Environment Variables.
- Next, under System Variables click to highlight the Path option.
- Then click Edit.
- Now click New and add the C:WindowsSysWow64 element as a new entry for system variables.
- Click OK to save the edit and follow up by restarting the computer.
This will fix the command hang issue on Windows 11. So here are the different troubleshooting methods you can do. I hope it will be useful.