Using Schtasks.exe, I have scripted DelSchNever.bat to delete all tasks are Never scheduled to run again, and have a nul Status.
@echo off for /f "Tokens=1-3 Delims=," %%a in ('schtasks /Query /FO CSV /NH^|FIND "Never"') do ( if %%b EQU "Never" If %%c EQU "" SCHTASKS /DELETE /F /TN %%a )I have also scripted SchDelSchNever.bat, which is designed to be scheduled to run when your computer starts. It wakes up every 15 minutes and calls DelSchNever.bat to delete tasks. Don't forget to uncheck the Stop the task if it runs for: box on the Settings tab.
@echo off :again @ping -n 901 127.0.0.1>nul call DelSchNever.bat goto again