sodcalculator

10 Tech How-To

Fix Command Prompt Keep Popping Up on Windows 10

Guide 10-16625 · Updated · Step by step

If the Command Prompt window keeps popping up on Windows 10, the cause is almost always a scheduled task, a startup entry, or a misconfigured shortcut—and you can stop it by disabling that trigger. This guide walks you through the exact steps to find and fix the culprit, plus how to prevent it from coming back.

Why Does Command Prompt Pop Up Randomly?

Command Prompt (cmd.exe) is a legitimate Windows tool, so it doesn’t appear by accident. When it flashes on screen, something is telling Windows to launch it. The most common triggers are:

  • Scheduled tasks – Windows or third-party software creates tasks that run cmd.exe at logon, at startup, or on a timer.
  • Startup folder entries – A shortcut or script in the Startup folder runs cmd.exe every time you sign in.
  • Registry Run keys – Programs add entries to HKCU\Software\Microsoft\Windows\CurrentVersion\Run (or HKLM) that launch cmd.exe.
  • Task Scheduler library – Hidden tasks from apps like Adobe, Java, or even Windows itself can trigger a brief cmd window.
  • Malware or adware – Less common, but some infections use cmd.exe to run scripts. This is rare but worth ruling out.

The window may appear for a split second and vanish, or stay open for a few seconds. Either way, the fix is the same: find the trigger and disable it.

Check the Startup Folder First

The Startup folder is the easiest place to look. It’s a folder that Windows runs automatically when you log in. To check it:

  1. Press Win + R, type shell:startup, and press Enter. This opens your personal Startup folder.
  2. Look for any shortcut, .bat, .cmd, or .vbs file. If you see one, right-click it and select Delete (or move it to your desktop to test).
  3. Also check the common Startup folder: press Win + R, type shell:common startup, and press Enter. Repeat the same check.

If you find a suspicious file, delete it and restart. If the popup stops, you’ve solved it. If not, move on to Task Scheduler.

Disable the Scheduled Task That Runs cmd.exe

Task Scheduler is the most common hiding spot for these popups. Here’s how to inspect it:

  1. Press Win + S, type Task Scheduler, and open the app.
  2. Click Task Scheduler Library in the left pane. This shows all tasks.
  3. Look for tasks with names that include cmd, bat, script, or the name of a recently installed program. Also check the Triggers column for tasks that run “At log on� or “At startup�.
  4. Double-click a suspicious task, go to the Actions tab, and see if the action is cmd.exe or a .bat file.
  5. If you find one, right-click it and choose Disable (not Delete, so you can re-enable if needed).

If you don’t see anything obvious, enable the Task Status column and look for tasks that ran recently. You can also sort by Last Run Time to spot the one that matches the popup timing.

Check Registry Run Keys

If neither the Startup folder nor Task Scheduler has the culprit, check the registry. This is where many programs silently add startup commands. Be careful—editing the registry incorrectly can break things, so only delete entries you’re sure about.

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.
  3. Look for any value that points to cmd.exe, a .bat file, or a suspicious path. Right-click and Delete it.
  4. Also check HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (and the Wow6432Node variant if you’re on 64-bit Windows).

If you’re not comfortable editing the registry, you can use the built-in Startup Apps settings (Settings > Apps > Startup) to see and disable entries, though it doesn’t show everything.

Use Autoruns for a Deeper Scan

If the above steps don’t find it, a free tool called Autoruns from Microsoft Sysinternals shows every startup item in one place. It’s not a Microsoft Store app, but it’s a well-known utility used by IT pros. Download it, run it as administrator, and look for any entry with “cmd� or “bat� in the command line. Uncheck the box next to the culprit and restart.

Autoruns also shows scheduled tasks, services, and drivers, so it’s the most thorough way to catch a hidden trigger.

What If It’s Malware?

If you’ve checked all the above and nothing matches, a malware infection could be the cause. Run a full scan with Windows Defender (Settings > Update & Security > Windows Security > Virus & threat protection > Scan options > Full scan). If that finds nothing, try a second opinion with a reputable on-demand scanner. Malware that uses cmd.exe often creates a scheduled task with a random name, so check Task Scheduler again after the scan.

Frequently Asked Questions

Why does Command Prompt flash at startup then disappear?

That’s the classic symptom of a scheduled task or startup entry that runs a quick command. The window opens, executes, and closes so fast you barely see it. The fix is to find the trigger and disable it, as described above.

Can a Windows update cause Command Prompt to pop up?

Yes, occasionally Windows updates create scheduled tasks that run cmd.exe for cleanup or configuration. If the popup started after a recent update, check Task Scheduler for tasks with “Microsoft� in the name and recent creation dates. Disable the one that matches the timing.

Is it safe to disable all Command Prompt tasks?

No. Some tasks are required for Windows to function correctly. Only disable tasks that clearly run cmd.exe and that you can tie to the popup. If you’re unsure, search the task name online before disabling.

What if the popup appears every few minutes, not just at startup?

That suggests a scheduled task with a repeating trigger. Open Task Scheduler, look for tasks that run every 5 or 10 minutes, and check their actions. Disable the one that launches cmd.exe.

Will System Restore fix this?

If the popup started recently, System Restore can roll back to a point before the trigger was added. It’s not a guaranteed fix, but it’s a safe option if you can’t find the cause manually. Create a restore point first, then run System Restore.

How do I stop Command Prompt from opening on a specific user account?

If it only happens for one user, check that user’s Startup folder and HKCU Run key. If it happens for all users, check the common Startup folder and HKLM Run key. Task Scheduler tasks can be set to run for a specific user or all users, so check the task’s “Run as� setting.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →