LootBiS / Windows fix / Flashing black window
A black window that flashes and vanishes
In our case the black window was opened by a program of our own, running in the background. The rhythm was the best clue: it came back every 30 minutes.
Our case
- Windows 11. Since the day before, a black console window flashed on screen and closed by itself.
- Task Scheduler showed nothing at first: its history is off by default.
- With process creation auditing turned on, as an administrator, the next flash named the parent: a background script of ours that started PowerShell every 30 minutes. The 30 minutes matched the script's own timer.
- The fix kept the script running: it now starts PowerShell without a window, with the Windows no-window flag. The flashes stopped.
How to find what opens it
- Note the times of a few flashes. A steady rhythm points to something on a timer.
- Open Task Scheduler, turn on the history of all tasks, and look at what ran at those times.
- Run Autoruns, from Microsoft Sysinternals, to see every program set to start automatically.
- As an administrator, turn on process creation auditing:
auditpol /set /subcategory:"Process Creation" /success:enable. After the next flash, event 4688 in the Security log names the program that started the window. - Process Monitor, also from Sysinternals, can draw the process tree when the log is not enough.
- When you are done, turn the auditing back off: replace enable with disable in the same command.
Once you know the program
- If it is yours, start the child program without a window: the CREATE_NO_WINDOW flag, or PowerShell with -WindowStyle Hidden. The program keeps running, the window stops.
- If you do not recognize the program, be careful before hiding anything: hidden PowerShell windows are also an attacker technique. Check the program with your security software first.
- Known older case: in 2017 an Office 365 task flashed a command prompt window on many PCs.
Good to know
- Task Scheduler can show when tasks ran, but its history is off by default; Enable All Tasks History turns it on.1,2,3
- With the Audit Process Creation policy on, Windows logs event 4688 (A new process has been created) each time a process starts; the auditpol command can turn it on.4,5,6
- Changing the audit policy needs administrator rights.5,7
- Event 4688 names the process that started the new one, its creator.4,6
- The full command line is not in event 4688 by default; it needs a separate policy, Include command line in process creation events.4,5,6
- Sysinternals Process Monitor has a process tree that shows which process started which.8,9
- Sysinternals Autoruns lists the programs set to start automatically.10,11
- The Windows flag CREATE_NO_WINDOW (0x08000000) starts a console program without a console window.12,13
- PowerShell can be started with -WindowStyle Hidden.14,15
- In 2017, an Office 365 scheduled task, OfficeBackgroundTaskHandlerRegistration, made a command prompt window flash on screen.16,17,18
- Hiding a PowerShell window with -WindowStyle Hidden is also a known attacker technique, which security tools watch for.19,20
How we checked this page
Checked on October 20, 2026. We kept a fact only when two independent publishers agree, and each one is numbered to its sources below. The case at the top is our own, on the setup it names. This page was written with an AI assistant and checked against the sources below.
Sources
- How to check scheduled tasks in Windows, Digital Citizen
- How to Enable or Disable Task Scheduler History, NinjaOne
- How to enable Task Scheduler history on Windows 11, Pureinfotech
- 4688(S): A new process has been created, Microsoft
- Audit Process Creation and Command Line, Elastic
- Building a Detection Foundation: Part 2 - Windows Security Events, TrustedSec
- Manage auditing and security log, Microsoft
- Process Monitor, Microsoft
- How to Use Process Monitor and Process Explorer, Help Desk Geek
- Autoruns for Windows, Microsoft
- How to Use Autoruns to Disable Startup Programs on Windows, Help Desk Geek
- Process Creation Flags, Microsoft
- How to Run Console Programs Without a Console Window, Helge Klein
- about_PowerShell_exe, Microsoft
- PowerShell.exe, SS64
- Seeing a Command Prompt box flash quickly on Windows 10? It's because of Office, Windows Central
- Windows 10: zyklisches DOS-Popup-Fenster (Fixes), Borns IT- und Windows-Blog
- How to Fix CMD Keeps Popping Up in Windows, Guiding Tech
- Hide Artifacts: Hidden Window (T1564.003), MITRE ATT&CK
- Windows Powershell Connect to Internet With Hidden Window, Splunk Security Research