Helping millions of people navigate the world of technology.

4 Ways to Fix Command Prompt Keeps Popping Up in Windows 11

Quick Tips
  • Ensure that Command Prompt or Terminal isn’t set as a startup app on Windows.
  • The “OfficeBackgroundTaskHandlerRegistration” service can sometimes cause the Command Prompt to open by itself, so it’s best to disable it.
  • Start your PC in clean boot mode to check if one of your third-party programs is causing the Command Prompt to open.

Try Basic Fixes

  • Scan for malware: Command Prompt’s unusual behavior could be due to a malware or virus infection. To rule out this possibility, run a full system scan using Windows Defender or a third-party antivirus program.
  • Install Windows updates: The Command Prompt may be opening randomly due to a bug within Windows. If that’s the case, installing pending updates should help.

Fix 1: Stop Command Prompt From Opening at Startup

If you have previously set up Command Prompt as a startup app in Windows, it may launch automatically whenever your computer boots up. Here’s how to stop that.

Step 1: Press the Ctrl + Shift + Esc keyboard shortcut to open the Task Manager.

Step 2: Switch to the Startup apps tab and locate cmd or Terminal on the list. Right-click on it and select Disable.

Disable CMD as Startup App in Windows

You also must ensure that the Command Prompt’s EXE shortcut isn’t added to the Startup folder on Windows. For that, press the Windows key + R to open the Run dialog box. Type shell:startup in the box and press Enter.

Locate and select shortcuts for Command Prompt or Terminal. Then, click the trash icon at the top to delete them.

Disable CMD and Terminal as Startup App in Windows

Fix 2: Disable Office Background Tasks

OfficeBackgroundTaskHandlerRegistration is a service that executes background tasks for Office apps on your PC. However, this service is known to cause random Command Prompt pop-ups on Windows. Here’s how you can stop the service from running automatically on your system.

Step 1: Press the Windows key + S to open the search menu, type task scheduler, and press Enter.

Open Task Scheduler

Step 2: Double-click Task Scheduler Library in the left pane to expand it.

Task Scheduler Window

Step 3: Expand the Microsoft folder > click on Office.

Office Folder in Task Scheduler

Step 4: Right-click the OfficeBackgroundTaskHandlerRegistration entry in the middle pane and select Disable.

Disable Office Registration Tasks on Windows

Fix 3: Modify Registry Files

Another thing you can do to stop Command Prompt from opening is to remove its automatic startup entry from the registry files. Here’s how to do it.

Step 1: Click the search icon on the taskbar, type registry editor, and select Run as administrator.

Open Registry Editor as Admin

Step 2: Paste the following path in the address bar at the top and press Enter.

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Step 3: Locate the CMD entry in the right pane. Right-click on it and select Delete.

Remove CMD Entry From the Registry Editor

Step 4: Select Yes to confirm.

Confirm Remove CMD Entry From the Registry Editor

Fix 4: Perform a Clean Boot

Malicious programs and services running on your PC can also cause Command Prompt to appear and disappear automatically. You can start Windows in a clean boot state to check for this possibility.

Step 1: Press the Windows key + R to open the Run dialog. Type msconfig in the box and press Enter.

Step 2: Under the Services tab, check the Hide all Microsoft services box and click Disable all button.

Disable Third-Party Services on Windows

Step 3: Switch to the Startup tab and click on Open Task Manager.

Open Task Manager on Windows

Step 4: In the Task Manager window, select a third-party app or program and click on Disable at the top. Repeat this step to disable all third-party apps and programs.

Disable Third-Party Startup Apps on Windows 11

Restart your PC to enter a clean boot state and try using it for a while. If the Command Prompt does not open automatically during this time, it means the third-party app or program responsible for the issue got disabled. You can remove any recently installed apps and programs and see if that fixes the problem.

Was this helpful?

Thanks for your feedback!

Last updated on 06 August, 2024

1 Comment

Leave a Reply

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

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.