Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

2 Command Prompt Windows at Startup: Causes & Fixes

· 6 min read · Home Tech

In this article
  1. 1. Check Startup Apps in Task Manager
  2. 2. Inspect the Startup Folder
  3. 3. Review Scheduled Tasks at Logon
  4. 4. Check the Run Registry Keys
  5. 5. Look for Leftover Installer Scripts
  6. 6. Use Autoruns for a Complete View
  7. 7. Check Group Policy Logon Scripts
  8. 8. Disable OneDrive or Cloud Sync Startup
  9. 9. Run a Clean Boot to Isolate the Cause
  10. 10. Create a New User Profile as a Last Resort
  11. How to Choose
  12. Frequently Asked Questions
  13. Final Thoughts

Seeing two Command Prompt windows open every time you boot Windows is almost always caused by a duplicate startup entry, a scheduled task running at logon, or a leftover script from an installer. The fix is to find the source, not to disable Command Prompt itself. Below are the most common causes and the specific steps to stop each one, followed by guidance on how to choose the right fix for your situation.

1. Check Startup Apps in Task Manager

Press Ctrl+Shift+Esc to open Task Manager and switch to the Startup apps tab (called Startup in older builds). Look for two entries with the same name, or a Command Prompt or .bat entry listed twice. Right-click each duplicate and choose Disable. Labels vary slightly by Windows version, but the tab is present in Windows 10 and 11. Restart to confirm only one window appears.

2. Inspect the Startup Folder

Press Win+R, type shell:startup, and press Enter. This opens the per-user Startup folder. Check for duplicate shortcuts, especially ones pointing to .bat, .cmd, or .vbs files. Also open shell:common startup for the all-users folder. If you find the same script in both folders, delete one copy. Do not delete files you do not recognize without first checking their target path.

3. Review Scheduled Tasks at Logon

Open Task Scheduler from the Start menu and click Task Scheduler Library. In the middle pane, look for tasks with a trigger set to "At log on" or "At startup." Sort by name to spot duplicates. If two tasks run the same script, disable one by right-clicking and choosing Disable. Be careful not to disable tasks belonging to Windows or your antivirus; check the Actions tab to see what each task actually runs.

4. Check the Run Registry Keys

Press Win+R, type regedit, and press Enter. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run. Each value name is a startup item. If you see the same name or the same command in both keys, one is likely a duplicate. Before deleting anything, right-click the value, choose Export, and save a backup. Then delete only the duplicate entry.

5. Look for Leftover Installer Scripts

Some installers leave a .bat file in your user profile or in C:\ProgramData that runs at logon to finish setup. Search for recently created .bat or .cmd files in those locations. If you find one that references an installer you have already completed, you can safely remove it from the startup entry that launches it. Do not delete the file itself unless you are sure it is not needed by an application.

6. Use Autoruns for a Complete View

Microsoft Sysinternals Autoruns shows every autostart location in one list, including logon scripts, scheduled tasks, and services. Download it only from the official Microsoft Sysinternals page. Run it as administrator, then use the Options menu to hide signed Microsoft entries so third-party duplicates stand out. This is the fastest way to spot two entries pointing to the same command when Task Manager and the Startup folder look clean.

7. Check Group Policy Logon Scripts

On a work or school PC, two Command Prompt windows can come from domain Group Policy. Open Local Group Policy Editor (gpedit.msc) and go to User Configuration > Windows Settings > Scripts (Logon/Logoff). If a script is listed twice, that is your cause. On a managed device you may not be able to change this yourself; contact your IT administrator instead of editing policy.

8. Disable OneDrive or Cloud Sync Startup

Some cloud sync clients launch a command-line helper at logon in addition to their main app. Check the Startup apps tab for entries named after your sync client. If you see two entries from the same publisher, disable the one labeled as a helper or updater. This is common with backup tools and sync clients, and it is safe to disable the duplicate helper while leaving the main app enabled.

9. Run a Clean Boot to Isolate the Cause

Type msconfig in the Start menu search and open System Configuration. On the Services tab, check Hide all Microsoft services, then click Disable all. On the Startup tab, open Task Manager and disable all startup items. Restart. If only one Command Prompt window appears, re-enable items in small groups until the second window returns; the last group you enabled contains the culprit. Re-enable everything when you are done.

10. Create a New User Profile as a Last Resort

If the duplicate persists after all the above, the cause may be a corrupted user profile. Create a new local account in Settings > Accounts > Other users, sign in to it, and check whether two windows still appear. If they do not, your old profile is the problem. Moving files to the new profile is safer than editing the registry further. Note that deleting a profile removes its desktop, documents, and app settings, so back up first.

How to Choose

Start with the simplest check: Task Manager's Startup apps tab and the Startup folder. These cover most duplicate-entry cases and take under a minute. If those are clean, move to Scheduled Tasks and the Run registry keys, which catch scripts that Task Manager does not list. Use Autoruns only when you need a complete view, because it exposes many entries and it is easy to disable something important by mistake. On a managed device, check with IT before changing Group Policy or scheduled tasks. A clean boot is the right choice when you cannot find the source by inspection, and a new profile is the last resort after everything else fails.

Frequently Asked Questions

Is it safe to disable a Command Prompt startup entry?

Usually yes, if you know what the entry runs. Right-click the entry and check its command or target path first. If it points to a script you recognize, disabling it is safe. If you do not recognize it, export a backup before changing anything.

Why do two windows appear only sometimes?

Intermittent duplicates often come from a scheduled task that runs at logon but is delayed, or from a sync client that starts a helper only when it detects a network connection. Check the task's trigger settings and the sync client's startup options.

Can malware cause two Command Prompt windows?

It is possible but uncommon. Run a full scan with Microsoft Defender or your antivirus. If the windows persist and you cannot find a legitimate source in Autoruns or Task Scheduler, seek help from a professional rather than deleting system files.

Will disabling the entry break my app?

Disabling a duplicate entry usually will not, because the other copy still runs. If an app stops working, re-enable the entry and look for a different duplicate instead. Keep a note of what you disabled so you can reverse it.

Do these steps work on Windows 11?

Yes. The Startup apps tab, Startup folder, Task Scheduler, and Registry paths are the same in Windows 10 and 11. Menu labels can differ slightly by version and region, but the locations are equivalent.

Final Thoughts

Two Command Prompt windows at startup are a symptom, not a setting. Find the duplicate entry in Task Manager, the Startup folder, Scheduled Tasks, or the Run keys, and remove only the copy you can identify. Back up registry values before deleting them, and use a clean boot when inspection fails. That approach fixes the cause without touching Command Prompt itself.