Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Windows Server » Task Scheduler shows task still running despite successful
  • Add additional Windows drives
    How to Add Another Hard Drive to a Virtual Machine in HyperV  Virtualization
  • certificate import and export on windows
    Export and Convert Private Keys to .PEM Format in Windows Windows
  • How to Change the Default Web Browser on Windows 11 banner
    How to Change the Default Web Browser on Windows 11 Windows
  • How To Remove Takeprize50.life Redirect From Mac unboxhow
    Remove unwanted site redirects or pop-ups from Google Chrome Mac
  • How to Activate Full-Screen (Kiosk Mode) in Internet Explorer Windows
  • Join Synology NAS to Active Directory Domain and Create New Users
    Create New Users and Join Synology NAS to Active Directory Reviews
  • sync
    AD Connect Sync Service Not Running: Start ADSync to Continue AWS/Azure/OpenShift
  • BitLocker Recovery Password Rotation in Active Directory
    Perform BitLocker Recovery Password Rotation in Active Directory Windows Server

Task Scheduler shows task still running despite successful

Posted on 25/04/202312/10/2024 Christian By Christian No Comments on Task Scheduler shows task still running despite successful
schedulepythontasksinWindows

In this article, I will show you how to resolve the “Task Scheduler shows task still running despite successful”. The Task Scheduler service enables you to run automated (scheduled) tasks on a desired device. Please see the related articles: how to Run or Edit and Delete Tasks via Windows Task Scheduler, How to create an Advanced Windows Scheduled Task, How to Monitor Windows Server Backup via PowerShell, and Microsoft Management Console: How to fix Windows Task Scheduler Service Greyed Out in Services MMC.

With this service, you can schedule any program to run at a convenient time for you or when a specific event occurs. The Task Scheduler monitors the time or event criteria that you choose and then executes the task when those criteria are met.

Please see how similar errors were resolved: How to Fix Windows Task Scheduler Error 0x1, how to fix Windows Task Scheduler 0x2 Error, and how to fix Failed to create a new scheduled task name RemoteException: Cannot create the file when that file already exists.

Why was this error “Task Scheduler shows task still running” prompted?

I have scheduled this task and many others to run depending on my triggers on a daily/weekly/monthly basis in windows server 2022. Unfortunately, only this job kept running.

This error was caused because the “matplotlib.pyplot.show function” was not commented out when added to the script or omitted in general as it is only relevant in the terminal and not from the automated task.

This is why the desired result will be achieved, but the job will continue running as the output is displayed. Please see the image below for more information.

reason-for-the-error

As you can see below, the task is still running. It should be ended by now. I will show you how I resolved this very quickly and how it you will be able to have your own issue(s) resolved as well.

Task-Scheduler-does-not-stop

You have to understand your script in order to be able to resolve this issue.

Please see Fix FileNotFoundError: [Errno 2] No such file or directory. Also, see how to apply Windows Updates with PowerShell, and How to fix “An Attempt Was Made to Reference a Token That Does Not Exist” in Windows 10.

Other Solutions were tried and Task Scheduler Setting in place Never worked

1: Despite having to stop the running task manually, the following code was prompted. This Task Scheduler code means “The last run of the task was terminated by the user.”. This did not solve the issue.

Do not bother restarting your PC or killing any process in order to fix this issue as claimed by many blogs!

Note: The Status Task Refresh does not also help or change the Status changed to Ready.

Please see the following related article: Microsoft Management Console: How to fix Windows Task Scheduler Service Greyed Out in Services MMC. How to create an Advanced Windows Scheduled Task, and How to schedule Windows Defender Antivirus to scan on Windows.

PC-restart-result-in-this-Task-scheduler-Error

2: As you can see from my Task Scheduler Settings, and trigger Tab. I have configured it to ask to stop, but this did not help because the script was not running correctly, but the image from the “matplotlib.pyplot.show function” displayed.

"Stop the task if it runs longer than" is set to 1 hour under settings tab and triggers tab.
"If the running task does not end when requested, force it to stop" is checked.
stop-task-longer-than-1hour
Edit-Trigger-Stop-task-after-1-hour

Before jumping to how I resolved this issue, I would like to explain what Matplotlib is. Please proceed as we work through this issue together.

What is Matplotlib?

Matplotlib is a library in Python and it is a numerical mathematical extension for the NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface.

Solution “Resolving Task Scheduler shows the task still running after completion”

As I have hinted previously, the show() function in pyplot module of matplotlib library is used to display all figures. As this is displayed, the job cannot end.

Since I have decided to automate this job, I will have to comment on this ut or remove it. In my case, I will just comment it out. For a similar script, please see Run Python Script via Windows Task Scheduler.

Fixed-error

When this is done, run the job again manually, and it will end successfully. Please see the image below.

After a successful run, it closes the Python script, and the task is done and changes its status to Ready.

task-completed-successfully

Please see Export and Import Scheduled Tasks in Windows, and how to configure log on as a batch job permissions on any server.

I hope you found this blog post helpful on how to fix “Task Scheduler shows task still running despite successful”. If you have any questions, please let me know in the comment session.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Windows, Windows Server Tags:Microsoft Windows, Task Scheduler, Windows 10, Windows 11

Post navigation

Previous Post: How to hide Folders and Files from Search Results in Windows
Next Post: Install and configure TeamPass Password Manager

Related Posts

  • xyxc
    How to link a removable media to a Deployment Share: Replicate Deployment share to a removable device Windows Server
  • rdp4
    How to change the default RDP port in Windows Network | Monitoring
  • 5rgh65436
    New Windows 11 encryption features and security enhancements for Hybrid Work Security | Vulnerability Scans and Assessment
  • MachineAccountQuota
    Change the number of MachineAccountQuota a user can add to AD Windows Server
  • Change BitLocker Password in Windows
    How to Change BitLocker Password in Windows Security | Vulnerability Scans and Assessment
  • How to Change the Default Web Browser on Windows 11 banner
    How to Change the Default Web Browser on Windows 11 Windows

More Related Articles

xyxc How to link a removable media to a Deployment Share: Replicate Deployment share to a removable device Windows Server
rdp4 How to change the default RDP port in Windows Network | Monitoring
5rgh65436 New Windows 11 encryption features and security enhancements for Hybrid Work Security | Vulnerability Scans and Assessment
MachineAccountQuota Change the number of MachineAccountQuota a user can add to AD Windows Server
Change BitLocker Password in Windows How to Change BitLocker Password in Windows Security | Vulnerability Scans and Assessment
How to Change the Default Web Browser on Windows 11 banner How to Change the Default Web Browser on Windows 11 Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Add additional Windows drives
    How to Add Another Hard Drive to a Virtual Machine in HyperV  Virtualization
  • certificate import and export on windows
    Export and Convert Private Keys to .PEM Format in Windows Windows
  • How to Change the Default Web Browser on Windows 11 banner
    How to Change the Default Web Browser on Windows 11 Windows
  • How To Remove Takeprize50.life Redirect From Mac unboxhow
    Remove unwanted site redirects or pop-ups from Google Chrome Mac
  • How to Activate Full-Screen (Kiosk Mode) in Internet Explorer Windows
  • Join Synology NAS to Active Directory Domain and Create New Users
    Create New Users and Join Synology NAS to Active Directory Reviews
  • sync
    AD Connect Sync Service Not Running: Start ADSync to Continue AWS/Azure/OpenShift
  • BitLocker Recovery Password Rotation in Active Directory
    Perform BitLocker Recovery Password Rotation in Active Directory Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.