Fix: Command Prompt window opening up and closing automatically in Windows 11

Is a Command Prompt window closing as soon as it is popping up on your new Windows 11 machine? Some users have reported this issue in multiple forums that a Command prompt terminal is briefly flashing on the screen before crashing down instantly when they are starting up their systems. If you are facing such an issue on your computer, follow these resolutions to identify and fix the problem quickly.

Fix 1 – Add a new Environmental Variable

You have to add an extra environment variable as it can go missing after upgrading your system to Windows 11.

1. At first, press the Windows key+R keys together.

2. Then, type “sysdm.cpl” and hit Enter.


Sysdm New Min


3. Now, go to the “Advanced” tab.

4. Then, tap on the “Environment variables“.


Enviroment Varibles Min


5. Next, select the “Path” parameter in the System variables.

6. Then, tap on the “Edit…“.


Path Edit Min


7. When the Edit environment variable window appears, tap on “New“.

8. Then, paste this address in the blank space to complete the process.


9. Don’t forget to tap on “OK” to save this change.


New Min


After that, close the Task Scheduler window and restart your computer.

Once the system boots up, check whether the same terminal is still appearing or not.

Fix 2 – Delete AUTORUN key in Registry

1: At first, press the Windows key+R keys together.

2: Then, type “regedit” in the Run terminal and hit Enter.


1 Run Regedit Optimized


3: Go to the following Location in Registry editor


4: Now, Under Microsoft key , try to locate command processor key

5: If you can find command processsor key, then select that key.

6: In the right side, if you can locate AUTORUN key, then just delete that key

Screenshot 2022 12 17 120214 Min


7: Similarly go to HKEY_CURRENT_USER\Software\Microsoft 

8: Repeat the same steps from 4 to 6 and delete AUTORUN from right side , if you can find it.

9: Restart PC

Fix 3 – Modify the registry

If malware is using your machine to mine cryptocurrencies, a terminal window will open up and start the operation as soon as your machine boots up.

1. At first, press the Windows key+R keys together.

2. Then, type “regedit” in the Run terminal and hit Enter.


1 Run Regedit Optimized


Warning – Before modifying the registry on your computer, you should create a registry backup on your system. So, pay close attention to these instructions.

When the Registry Editor opens up, click on “File“. Then click on “Export” to make a new backup on your computer.


Export Registry Windows 11 New Min


3. When the Registry Editor opens up, click on “Edit“.

4. Then, tap on “Find…“.




5. Now, type “SOUNDMIXER” in the box.

6. Then, click on “Find Next” to find the key


Soundmixer Min


Now, Windows will find and locate the key in the Registry Editor. If it doesn’t find any key related to ‘SoundMixer’, then this is not the reason you are facing this issue. You may skip to the next solution.

6. When you have found the affected key, right-click on the “AutoRun” key on the right-hand pane.

7. Now, tap on “Delete” to remove it from your computer.


Autorun Delete Min


7. You will see a warning message. Just, click on “Yes” to confirm the removal.


Yes Min


After doing this, close the Registry Editor. Then, restart your computer.

Fix 4 – Disable Office task

Whenever your computer starts up, the Office license is verified by the auto executing OfficeBackgroundTaskHandlerRegistration task.

1. At first, press the Windows key+R keys together.

2. Then, write this command and click on “OK“.



Task Scheduler Min


3. When the Task Scheduler opens up, go this way ~

Task Scheduler (Local) > Task Scheduler Library > Microsoft > Office


4. Now, on the right-hand pane, you will find the  “OfficeBackgroundTaskHandlerRegistration“.

5. Then, right-click on the task and tap on “Disable“.


Disable It Min


After disabling the task, close the Task Scheduler and restart your computer.

Fix 5 – Run a deep scan

A malware or PUP can autostart at the boot to start working in the background. Use Windows Security to run a full scan to identify and remove any malware.

1. At first, press the Windows key and type “Windows Security“.

2. Then, tap on the “Windows Security” to open it.


Windows Security Min


3. In Windows Security, tap on the “Virus & threat protection“.


Virus And Threat Min

4. To view the all the scan options, tap on “Scan options“.


Scan Options Min


5. Then, select the “Full scan” option amidst all the available scan options.

6. Finally, tap on “Scan now” to start the full scan.


Full Scan Scan Now Min


Keep this is in mind that this process will take a long time depending upon the number of apps/files you have on your system.

Windows will scan all the files and remove any script, malware from your system. After running the scan, restart the system once and check again.


Fix 6 – Run a DISM Scan

You have to run a DISM scan to check and repair the system files if you have upgraded your computer from Windows 10 to Windows 11.

1. At first, press the Windows key+S keys together and type “cmd“.

2. Then, right-click on the “Command Prompt” and click on “Run as administrator” to access the terminal.


Cmd New Min


3. Once the Command Prompt opens up, paste these commands one by one in the terminal.

Then, hit Enter to cleanup existing image files.

DISM.exe /Online /Cleanup-image /Scanhealth
DISM.exe /Online /Cleanup-image /Restorehealth
DISM.exe /online /cleanup-image /startcomponentcleanup


Dism Scan Health New


Then, close the Command Prompt terminal and restart your computer.

When the system is starting up, check again.


Fix 7 – Use Process Monitor

Download and use the Process Monitor to check what process is causing this issue.

1. You have to download Process Monitor.

2. Once you have done that, close your browser.


Download Process Monitor Min


3. Once the zip file is downloaded, unzip the “Process Monitor” file.


Extract It Min


4. Now, double click on the “Procmon” to run it.


Procmon Dc Min


This will open up the Process Monitor on your computer. Wait for a while until the Process Monitor loads all the current processes.

5. Now, tap on “Filter” from the menu bar.

6. Then, click on the “Filter…” to filter out the specified process.


Filter Min


7. In the Process Monitor Filter window, set the first drop-down to “Operation“.

8. Then, set the next drop-down to “is“. Next, set it to “Process Create” from the list.

9. Next, click on “Add” to add the filter.

10. Finally, tap on “OK” to complete the process.


Operation Process Create Min


11. Now, all you have to do is wait for the Process Monitor to scan and show the processes matching the criteria you set in the filter.

You can minimize this and work alongside. After a while, come back again to Process Monitor and check whether you can find the culprit with the path of the executable file.


Process Monitor


If you are unsure about the origin/content of this file, just drop it in VirusTotal and check whether it is malware or virus.