Many users have reported that the CMD window opens and then suddenly closes within a second. Since it seems to pop up randomly at any instance, it becomes all the more challenging in finding the root cause of this problem. if you are also getting bugged with this issue, then fret not. In this guide, we will make you aware of various methods to fix the issue of Command Prompt pops up and closes randomly on Windows 11. So without any further ado, let’s get started.
How to Fix Command Prompt Pops Up and Closes on Windows 11
After doing a thorough investigation of this issue, we found that missing system environment path variable path, corrupt background task schedulers, malicious third party programs, or corrupted Windows images are some of the most common causes. So in this guide, we will be addressing all these plausible reasons which in turn will end up rectifying the CMD issue as well. Follow along.
FIX 1: Use DISM Command
DISM or Deployment Image Servicing and Management is a command-line tool that checks the system for all the corrupt Windows mages files and then replaces them with their working counterpart. So let’s put this tool to test right away: The scanning and fixing of corrupt system files might take a few minutes. Once done, restart your PC and then check if the issue of Command Prompt pops up and closes randomly on Windows 11 has been fixed or not.
FIX 2: Add Missing Environmental Variables
In case an environment variable is missing a PATH (such as C:\Windows\SysWow64) then the CMD will keep on trying to search that path, but in vain. As a result, it might end up in a bootloop. The only way out is to add that missing path so that the Command Prompt is able to read it for once and then stops its background scan, for good. Here’s how it could be done:
FIX 3: Scan via Windows Defender
It could well be the case that a harmful application or program (or even an autorun key) could be using the CMD window to run its script in the backend. The only way to verify it and more importantly prevent it from happening is to scan your PC via antivirus software. While you are free to choose any of your choices, but make sure to perform an in-depth scan, one that encapsulates the entire C drive at the very least. As for this guide, we will be proceeding ahead with Mircosoft’s built-in app. Follow along. The scanning process will take some time. Once done. check if it was able to fix the issue of Command Prompt pops up and closes randomly on your Windows 11 PC.
FIX 4: Disable App Background Schedule
In some cases, a third-party app might be running its schedule in the background via the Command Prompt. In my case, it was one of the OneDrive’s services that was set to be automatically invoked after every one hour- for an indefinite time period! So you should first verify whether there’s an app or service that is being invoked at regular intervals but could also work well and good even without that. And if there’s such an app, then you should consider disabling its automated schedule. Here’s how:
FIX 5: Delete SoundMixer Registry Value
Some users gave us a tip that a particular type of virus managed to escape from all the antivirus scans and had managed to get access to the Registry editor. Named SoundMixer, it is basically a crypto-mining autorun key that modifies the registry entries so that they could invoke the CMD window at regular intervals. To rectify it, you just need to delete the SoundMixer entry, but that might prove to be easier said than done. This is because there is no fixed location where it might be located, you will have to first search it and then subsequently remove it. Here’s how: So with this, we round off the guide on how you could fix the issue of Command Prompt pops up and closes randomly on Windows 11. We have shared five different fixes for the same. Do let us know in the comments section which one spelled out success for you. Likewise, all your queries are welcomed in the comments below.
Screenshot Folder Missing in Windows 11: How to FixSnipping Tool Not Working in Windows 11: How to FixWindows 11 Updates Failed Error: How to FixWindows 11 Restarts/Reboots Automatically: How to Fix