Command Prompt keeps popping up and closing on Windows 10 mostly because of Office background tasks, malware, or disk errors. This guide covers 6 solutions to stop CMD from opening randomly.

Why Does Command Prompt Keep Popping Up on Windows 10

Command Prompt (CMD) is a built-in Windows tool for tasks such as deleting partitions, formatting disks, and converting file systems. It is available on all modern Windows versions, including Windows 11, 10, and earlier.

Tips:
Do you know how to use CMD to manage your hard drive, partitions, and volumes? Read What Command Can Be Used to Manage Hard Drives, Partitions, and Volumes? to learn more.

Command Prompt

However, many users report that Command Prompt keeps popping up on their PCs, according to the Microsoft community and Google search results.

Hello, I have recently noticed that Command Prompt keeps popping up each half an hour or so. Even though it might seem like not a big deal, I’m a passionate gamer and it annoys me. Do you have any tips how to stop cmd.exe popup? Thank you!

The window disappears within a second, but it can still interrupt you while browsing, gaming, or working.

CMD usually keeps popping up in these situations:

  • when Windows starts, such as Windows 10;
  • while you are using the PC, such as playing games.

Why does Command Prompt open randomly?

A background process is usually launching cmd.exe for a moment. Common causes include:

  • Office background tasks in Task Scheduler;
  • startup programs or services;
  • malware;
  • disk errors, such as bad sectors.

The 6 solutions below cover each cause. They also work on Windows 11, with minor menu differences.

Solution 1: Check for the Bad Sectors

The bad sectors on your hard drive may be the cause of the issue. To check for the bad sectors on your hard drive, it is suggested to apply the third-party software named as MiniTool Partition Wizard that is a useful toolkit to help you manage your hard drive.

Tip: CMD, Disk Management, and MiniTool Partition Wizard are all useful utility to manage your hard drives and partitions, you can click Free Windows 7 Partition Manager: Partition Wizard, CMD, Disk Management to learn about their differences.

How to check the bad sectors for your hard drive with MiniTool Partition Wizard? Here are the specific steps.

MiniTool Partition Wizard FreeClick to Download100%Clean & Safe

Step 1: Download MiniTool Partition Wizard by clicking the offered download button. Then launch it to get its main interface.

Step 2: Select the disk and choose the Surface Test feature from the left panel to check the sectors for your hard drive. Or right-click the target disk at first, and then select the Surface Test feature from the drop-down menu.

click the Surface Test feature from the left panel

Step 3: Once you get the Surface Test window, please click the Start Now button in the new pop-up window to start the surface test.

click the Start Now button

There are two things you need to learn about:

  • Disk block without red error: this parameter means there is no bad sector on your hard drive.
  • Read error in this block: this parameter means there are some bad sectors on your hard drive.

Step 4: Wait for the test finishing. Once you get the test result, please check it.

Note: If there is no red square, it means there is no bad error and you need to try other solutions; if there are some red squares, it means you should send it for repair.

Solution 2: Run Windows Clean Boot

Windows Clean Boot is that your computer uses essential services and files that it needs to boot. 

Note: Please pay attention that you should log on to your computer as an administrator to perform a clean boot.

Here is the guidance to run Windows Clean Boot to fix Command Prompt keeps popping up.

Step 1: Press the Windows icon and the R key on the keyboard simultaneously. Once the Run window pops up, please type msconfig and then click the OK button.

type msconfig in the Run window

Step 2: When you get the System Configuration window, please move to the Services tab, and then select Hide all Microsoft services, and finally click Disable all.

click Hide all Microsoft services and Disable all

Step 3: Move to the Startup tab on the System Configuration window, and then click Open Task Manager.

Step 4: Click the OK button on Startup tab and then Restart PC.

After restarting your computer, your computer can work normally, and no CMD Should pop up anymore. But if not, please carry out the following solutions.

Solution 3: Disable MS Office Software from Task Scheduler

There is a possibility that MS Office software is causing the Command prompt to randomly pop-up. Therefore, you can try to disable MS Office software from Task Scheduler to fix the issue.

How to disable MS Office software to stop Command Prompt pop up? Here is the tutorial.

Step 1: Type Task Scheduler in the search box to open the program.

Step 2: Please select Task Scheduler Library, Microsoft, and Office in order.

Step 3: Find OfficeBackgroundTaskHandlerRegistration task and disable it by right-clicking it and then choosing the Disable option.

disable OfficeBackgroundTaskHandlerRegistation

Note: If Command Prompt keeps popping up, you should repeat Step 1 and Step 2 to disable OfficeBackgroundTaskHandlerLogon task as well.

If you don’t want to disable the MS office, there is another choice. You can change some settings that will make this task run in the background and the CMD stops pop up.

Here is the tutorial on how to change the settings of the MS office software.

Step 1: Right-click the OfficeBackgroundTaskHandlerRegistration and select the Properties option.

check the properties of the selected task

Step 2: Click Change User or Group.

click Change User or Group

Step 3: Type System and then click the OK button.

Step 4: Click the OK button again.

Note: If this could not fix the issue, please repeat the steps given above and disable the task named OfficeBackgroundTaskHandlerLogon as well.

If all the mentioned tasks have been disabled or changed their properties, and Command Prompt still randomly pops up, you can try the Solution 4.

Solution 4: Check File System

In this situation, you also need to take advantage of MiniTool Partition Wizard, for its Check File System feature can find and fix errors to stop Command Prompt pop up.

Note: The Check File System feature of MiniTool Partition Wizard can be only used when the selected partition has a drive letter. For the partition without a drive letter, you can assign one to it and then apply this feature.

Few Steps to apply the Check File System to find and fix errors:

Step 1: Launch the software to get its main interface.

Step 2: Select one partition on your hard drive and then choose the Check File System feature from the left panel.

select the check File System feature from the left panel

Step 3: Please select the second option Check & fix detected errors, and then click the Start button.

start check and fix the errors related to file system

Step 4: Wait for the checking and fixing process. Once this process comes to end, please check that Command Prompt still keeps popping up. If the solution fails, please try the next solution.

Solution 5: Apply Windows PowerShell

There are some commands you can use in Windows PowerShell to check if there is something getting download or not.

run Windows PowerShell

Solution 6: Run Windows Defender to Check for Malware

Malware often runs commands through cmd.exe, so an infection may be why Command Prompt keeps popping up and closing. Windows Security (Microsoft Defender) can find and remove most threats.

Tips:
Note:
The offline scan restarts your PC. Save open files and close all apps first to avoid data loss.

Step 1: Run the scan

  1. Type Windows Security in the Windows search box and open it.
  2. Select Virus & threat protection > Scan options.
  3. Choose Microsoft Defender Offline scan and click Scan now.

Your PC will restart and scan, which usually takes about 15 minutes.

Step 2: View the result

Open Windows Security again and go to Virus & threat protection > Protection history. Any malware found is removed or quarantined automatically. Then check whether Command Prompt still keeps popping up.

How to Stop Command Prompt From Popping up on Windows 10?Click to Tweet

Bottom Line

If Command Prompt keeps popping up on Windows 10, check scheduled tasks and startup programs first. You can also perform a clean boot, scan for malware, inspect background transfers, and check your hard drive for errors to identify the cause.

If you have any questions while using MiniTool software, contact us at [email protected].

Command Prompt Keeps Popping up FAQ

Is it safe to disable the OfficeBackgroundTaskHandler tasks?
Yes. They are background maintenance tasks, so disabling them does not uninstall Office. You can re-enable them in Task Scheduler at any time.
How do I get rid of Command Prompt?

Windows OS allows you to disable Command Prompt. To get rid of Command Prompt, follow the steps below.

  • Type gpedit.msc in the Windows search box and then press Enter.
  • In the Group Policy window, go to the path User Configuration > Administrative Templates > System.
  • Under the System folder, double-click Prevent access to the command prompt from the right pane. Change the Setting to Enabled and click OK.
Is cmd.exe a virus?
The answer is NO. The genuine cmd.exe file is a software component of Microsoft Windows by Microsoft, running Command Prompt. Therefore, it is safe.
How do I use Command Prompt?
Command Prompt is multi-functional as it can help us diagnose network, delete temporary files, shut down PC at a certain time, etc… when we type corresponding commands.
  • linkedin
  • reddit