Solution to the Prevent Shutdown Issue Caused by Traffic Monitor

Use task scheduler to force terminate TrafficMonitor.exe during shutdown to solve the issue in Windows 11

Background

Recently, I used Windhawk to move the taskbar on Windows 11 to the left of my screen, which caused Traffic Monitor’s taskbar window to fail to display correctly. As a workaround, I switched to displaying the main window instead. However, this feature has a bug on Windows 11 that blocks shutdown, requiring manual confirmation by clicking the “Shut down anyway” button to proceed.

I initially considered switching to a different system monitoring software, as Traffic Monitor hasn’t been updated for a long time. But after searching around, I found that no other software could meet my needs:

  • HWiNFO: The taskbar icons are too small and cannot display metric names.
  • Taskbar Monitor: It also failed to display properly in the taskbar.
  • TrayS: Its functionality overlaps with Windhawk, which may cause conflicts.
  • XMeters (Free Version): Updates only every 3 seconds.
  • Run Cat: Only shows CPU usage. Still, I decided to keep it—who can say no to having a little running cat in their taskbar?

I began looking for a fix to this bug and eventually found a solution in Traffic Monitor’s GitHub issue. The suggested method involved creating a scheduled task to force-terminate the Traffic Monitor process during shutdown.

However, the triggers mentioned in that method (event IDs 6006, 1073, and 1074) did not work as intended on my system (24H2). During shutdown, the system would still get stuck on the “Traffic Monitor is blocking shutdown” screen, as TrafficMonitor.exe was not terminated. If I canceled the shutdown and returned to the desktop, those triggers would fire, but by then it was too late. After checking the Event Viewer, I discovered that these events occur one second later than Traffic Monitor.exe attempting to block the shutdown, causing the triggers to fail at the critical moment. I then tried using the event (ID 10001) triggered by TrafficMonitor.exe’s attempt to block the shutdown itself as the task’s trigger. After testing, this approach worked as expected.

This method has a minor quirk: when you click the shutdown button, the “Traffic Monitor is blocking shutdown” screen will flash briefly, but it does not affect the shutdown process.

Detailed Steps

  1. Right-click the Start button on the taskbar and open Computer Management.
  2. In Event Viewer > Windows Logs > Application, locate the event where Traffic Monitor blocks shutdown, and note down the log name, source, and event ID.
  3. Open Task Scheduler and create a new task.
  4. Enter a name for the task and check Run with highest privileges.
  5. Switch to the Triggers tab and create a new trigger:
    1. Set Begin the task to On an event.
    2. Choose Application for the log (this option is at the bottom; you can press the End key to jump to it quickly).
    3. For the source, select Winsrv (type it in to quickly jump to it in the dropdown).
    4. Enter 10001 for the event ID.
  6. Switch to the Actions tab and create a new action:
    1. In the Program/script field, enter taskkill.
    2. In the Add arguments field, enter /f /im TrafficMonitor.exe.

Reference: 关机显示阻止关机问题 · Issue #998 · zhongyang219/TrafficMonitor · GitHub