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.
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.
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.
Step 2: Double-click Task Scheduler Library in the left pane to expand it.
Step 3: Expand the Microsoft folder > click on Office.
Step 4: Right-click the OfficeBackgroundTaskHandlerRegistration entry in the middle pane and select Disable.
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.
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.
Step 4: Select Yes to confirm.
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.
Step 3: Switch to the Startup tab and click on Open Task Manager.
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.
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?
Last updated on 06 August, 2024
1 Comment
Leave a Reply
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.
Helped out, a bunch!