Fix: Windows 11 Command Prompt Pops Up and Closes Randomly

Using Windows 11 computer is great fun when it comes to visual overhaul, improved stability, and performance all around. However, each and every Windows OS do come with a couple of new issues or bugs that plenty of users are facing whatsoever. Recently, some of the affected users are reporting that the Windows 11 Command Prompt Pops Up and Closes Randomly on their PCs which is quite unexpected. Are you one of them? Well, don’t worry.

Sometimes you may encounter unexpected pops up and closes of CMD (command prompt) window on the computer running on Windows 11 OS that may appear due to the conflict of the attached keyboard or mouse. In some scenarios, it may happen due to system-specific reasons too that can be considered as a bug. Luckily, here we’ve shared a couple of possible workarounds below that should help you out.

Fix: Windows 11 Command Prompt Pops Up and Closes Randomly

Fix: Windows 11 Command Prompt Pops Up and Closes Randomly

Sometimes missing environment variable paths, background office tasks, virus/malware, crypto mining processes, etc can cause such errors on the Windows 11 PC. So, it’s always better to fix such an issue manually by following the steps below.

1. Use DISM and SFC Command

Try using the Deployment Image Servicing and Management (DISM) command and SFC scan command on your Windows PC to fix several issues with the corrupted or missing files. DISM is a command-line tool that can be used to mount and service Windows images before deployment. To do so:

  • Click on the Start Menu and type cmd.
  • Now, right-click on Command Prompt from the search result.
  • Select Run as administrator > If prompted, click on Yes to give admin privileges.
  • Once the command prompt window opens, type the following command and hit Enter to execute it:
DISM.exe /Online /Cleanup-image /Scanhealth
  • Then type the following command and hit Enter:
DISM.exe /Online /Cleanup-Image /CheckHealth
  • Then type the following command and press Enter:
DISM.exe /Online /Cleanup-Image /RestoreHealth
  • Now, wait for the process to complete and exit the command prompt.
  • Finally, restart your computer to apply changes.

If that didn’t help you out of the issue then you should run the system file checker scan on your Windows PC to check for any kind of possible or corrupted system files and restore them.

Advertisements
  • Click on the Start Menu and type cmd.
  • Now, right-click on Command Prompt from the search result.
  • Select Run as administrator > If prompted, click on Yes to give admin privileges.
  • Once the command prompt window opens, type the following command and hit Enter to execute it:
SFC /scannow

  • Now, wait for the process to complete.
  • Once done, restart your computer to change effects immediately.

Also Read

Advertisement

How to Fix If Screenshot Folder Missing in Windows 11

Fix: Touchpad Not Working After Windows 11 Update

Fix: Internet Time Sync Error on Windows 10/11 | Synchronization Failed

How To Fix PowerShell Not Working Problem

2. Add Missing Environment Variable Paths

It may be possible that while upgrading the Windows 10 OS to Windows 11 can cause missing Environment Variable Paths. So, the chances are high that the path to “C:\Windows\SysWow64” gets missing. Luckily, you can follow the steps below to easily fix the Windows 11 Command Prompt Pops Up and Closes Randomly. To do so:

  • Press the Windows + R keys to open the Run dialog box.
  • Type sysdm.cpl and hit Enter to open the System Properties window on your computer.
  • Now, click on the Advanced tab under the System Properties window > Click on the Environment Variables button at the bottom.
  • Next, click on the Path section under the System Variables window > Click on Edit.
  • Then click on New in the Edit environment variable window > Paste the following in the text field:

C:\Windows\SysWow64\

  • Click on OK to save changes then click on OK again on all windows.
  • Now, make sure to restart your computer to change effects immediately.
  • Finally, you can check whether the missing Environment Variable path has been fixed or not.

3. Scan the PC using Windows Defender

Running the system files and other installed files on the computer may become corrupted or missing due to several reasons. In some cases, it’s worth mentioning to scan the PC system completely using the default Windows Defender program. To do this:

Advertisements
  • Go to Windows Settings > Click on Privacy & Security > Click on Windows Security.
  • Click on Virus & threat protection > Click on Quick Scan. [You can also opt-in for a Full Scan mode from Scan Options]
  • Wait for the process to be completed.
  • Once done, make sure to reboot the PC.

4. Disable App Background Schedule

Sometimes it can be possible that a third-party app might be running its schedule in the background using the Command Prompt method. So, it’s always a better idea to disable the app background schedule on the computer. To do that:

  • Press the Windows + R keys to open the Run dialog box.
  • Then type in the command below and hit Enter to launch Task Scheduler:
taskschd.msc
  • Now, expand the Task Scheduler Local option and select the Task Scheduler Library.
  • Make sure to take a quick look at the right side and check out the list of all the apps.
  • If in case, you find out any of the background scheduled apps that shouldn’t be running necessarily then make sure to right-click on the app.
  • Click on Disable > Do the same steps for all those apps which belong to the same domain.
  • Additionally, if you’re using the Microsoft Office Suite on the PC, then you should try considering disabling one of its services. Go to Task Scheduler (Local) > Click on Task Scheduler Library > Select Microsoft and Choose Office > Go to the right side and select the OfficeBackgroundTaskHandlerRegistration option > Right-click on it and select Disable.
  • Once done, just restart your PC to save changes and check whether the Windows 11 Command Prompt Pops Up and Closes Randomly or not.

5. Delete SoundMixer Registry Value

By deleting the SoundMixer Registry Value on your Windows computer, you’ll be able to remove a crypto-currency mining software (autorun tool) that modifies the registry entries on your system which may cause the CMD window to pop up or close randomly. You’ll just have to delete the SoundMixer entry on your system by following the steps below:

  • Press the Windows + R keys to open the Run dialog box.
  • Type regedit and hit Enter to launch Registry Editor.
  • Then click on Edit from the top menu bar and select Find.
  • Next, type SOUNDMIXER in the field and checkmark all three options such as Keys, Values, and Data.
  • Then make sure to uncheck ‘Match whole string only’ and hit the Find Next button.
  • Wait for the scan to complete and it should find out the SOUNDMIXER key or DWord File.
  • Just select it and right-click on it > Click on Delete.
  • You should again continue your search and delete all the remaining SOUNDMIXER entries individually.
  • Once all is done, restart your PC and check for the issue again.

That’s it, guys. We assume this guide was useful to you. For further queries, you can comment below.

Advertisements

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.