Find Why A Command Prompt Window Opens Repeatedly On Windows

Does a command prompt window open on your PC for a split second and then automatically close? You’re not alone. The command prompt window opens and closes so quickly, it will likely take you several days to figure out is the Command Prompt. The problem is, given how common security breaches and scams are getting this is enough to scare the average person. Perhaps you installed an app that came with spyware. Maybe someone is accessing your webcam and regularly taking photos of you. Or maybe it’s HP audio driver. Chances are, if you haven’t visited any exceptionally shady websites in the past, it’s nothing. To be sure, you need to figure out why there’s a command prompt window opens repeatedly in the first place. This will take a little time to figure out but time is really the only complicated bit.

Rule Out False Positives

We assume it’s a command prompt window that’s opening and closing. It might actually be something else. Sometimes, when you have multiple apps open, one on top of the other, they ‘flicker’ in and out of focus. You might be working in your browser when an app window in the background suddenly comes into focus and then quickly disappears. If this is what is happening, it’s going to be too quick for you to see what window it is. This is a false positive though so we need to rule it out.

Read More

In order to rule it out, check which apps you have running when this happens. In our experience, this happens most with apps that send frequent notifications e.g., messaging apps. Resize the app window you think might be the culprit. Make it smaller or just narrower than it normally would be. When an app window appears and disappears on your screen the next time, you will at the very least see what size the window was. If it matches the resized app window, you’ve found your problem.

Rule Out App Updates

Windows app don’t automatically update. It’s always a manual process. If you recently updated an app, it’s possible that it didn’t install properly. It’s also possible that a new version of the app is trying to run a process. If you haven’t recently updated an app, or installed a new one, you can rule this possibility out. You have to rely on your own memory here though. If you did install a new app, it might be the cause. This doesn’t necessarily mean the app is malicious. It can just be a bug.

Events Viewer

Open the Events Viewer when the window appears. Everything that happens on your system is logged here. Expand the Windows Log and go through the logs in Application, Security, Service, System, and Forwarded Events. Check out the event(s) that coincide with the date and time of the window appearing. Look out the details for this event. It will tell you which app opened the window.



This will identify which app or process is the problem. It’s up to you to decide what you do with the app. We can’t tell you what to do because it really depends on the app. If the cause of the window is a system process. you need to check out what’s going on. A good place to look is the Task Scheduler. Windows has processes that need to run periodically, or just every now and then. If you see Command Prompt window pop-up too often, it means something might be wrong.

Check Scheduled Tasks

Open the Task Scheduler app. It’s best to check it right after a window appears. Look at the recent tasks that have run. It’s likely you might find a task is constantly failing to run.

Open Task Scheduler and expand the Task Scheduler library. Go to Microsoft>Windows. Select the first folder and then go through all of them to see which one has a task that ran at the exact time the window opened. The log from the Event Viewer will help narrow down which folder to look through. The event that coincided with the window appearing will tell you which application created it. Look for the application folder for that app in the Task Scheduler to see if has a recurring task.

task scheuler win 10

Check why it’s running and if it’s running successfully. If the task fails to run, it may be the reason the window keeps popping up again and again. Of course it might be a periodic maintenance task which at the end of the day isn’t something to worry about.


Related posts