Many Windows users are encountering a problem of a command prompt cmd.EXE window that opens randomly and closes so quickly, that there is no time to do anything with it.
If you are also facing the black cmd.EXE window that keeps popping up and disappearing, most of all it is triggered by some automatic task that is launching it periodically.
This note shows how to identify and disable the scheduled task that causes cmd.EXE to keep popping up.
cmd.EXE Keeps Popping Up
Launch PowerShell and run the following command to list scheduled tasks:
PS C:\> Get-ScheduledTask | Get-ScheduledTaskInfo | Select TaskName, TaskPath, LastRunTime `
| Sort LastRunTime -Descending | out-gridview
The scheduled tasks displayed by the command are sorted by LastRunTime, so if the cmd.EXE window popped up recently, it will be easier to identify the task that was responsible for that:

In my case, I’ve noticed that the cmd.EXE had popped up at 8:49 PM and later I determined that it was triggered by the “BatteryStatusTest” task.
To identify which of the highlighted tasks was guilty in triggering the cmd.EXE to pop up and close, I had to search for each of them in “Task Scheduler”.
To open “Task Scheduler”, press ⊞ Win + R that will start the “Run” dialog, type in the taskschd.msc command and click “OK”:

In “Task Scheduler”, search and “Run” each of the suspected tasks in the corresponding paths to see which of them triggers the cmd.EXE window to pop up and then disappear:

Once the bastard is identified 💩 – right-click and “Disable” it to not see anymore the annoying popping up cmd.EXE window.
What do you mean (or how) to “search and “Run” each ……” in the Task Scheduler? Thanks
Hey, I did this couple days ago but found no task that triggers the cmd. Today I tried again and this time I saw the exact time it popped up but there was no entry in the list at that time slot, so I am pretty lost. Help is appreciated. 🙂