Windows 7 Bug - Task Scheduler Deleting Task Bat File?

I'm on Windows 7 Home Premium.

I have a simple set of bat files. One to log me into work, one to log me out. All they do is open Firefox, ping Google, and clock me on or off. For months, Task Scheduler has run these religiously without problem.

Today, I ran into this:

  • Task Scheduler deleted the .bat file halfway as it was running it.
  • I tried to copy paste a backup file into the folder with the other .bat file, it told me I didn't have permissions.
  • I re-took ownership of the folder, and the folder before it, and tried again. Task Scheduler deleted it and wrecked the permissions again.
  • I tried putting the bat files in System32 thinking it surely wouldn't delete it from there. Task Scheduler deleted the bat files again.
  • I've tried running the tasks with the "Hidden" option, and with the "Run with highest privilege" option. It continues to delete the file.
  • The bat files themselves run perfectly well when I launch them manually. So it is something that Task Scheduler is doing that is causing this malfunction.

I've had Windows Update turned on for months so nothing could have gotten changed overnight.

I restarted and run system file checker, anti-virus, anti-malware, and a registry editor. The issue continues.

UPDATE: I created new tasks for the same bat files and they worked fine. The old tasks were causing the error. I'd still like to know, does anyone know why they did this spontaneously?

I'd still like to know, does anyone know why they did this spontaneously?

Sorry, can't tell without seeing your batch files. You also need to consider the possibility of human interference or malware.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I'd still like to know, does anyone know why they did this spontaneously?

Sorry, can't tell without seeing your batch files. You also need to consider the possibility of human interference or malware.

Highly unlikely that it was human interference, and I did several malware scans. The batch files are simple, and as I said, they work properly when I launch them manually, and also work properly with the new tasks I set up for them

Here is the code in one of them if you still need it.

start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"  http://www.google.com
ping 127.1.1.1
Start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"   imacros://run/?m=LOGON.iim

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I just had this exact problem in Windows Server 2012 R2.  It seems to either be a bug in Task Scheduler or possibly Avast antivirus is doing it.  It is very annoying.
=== Jez ===

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You! You solved the issue. I was confused as to why you referenced Avast, and I checked Avast's virus vault - ALL my .bat files are there! every SINGLE copy I made in the process of trying to figure out how to fix it, they're ALL THERE. 

Lucky for us, we can right click on the file in its virus chest, and choose "Restore and make an exception"

Or, if you want to do it pre-emptively, open up the Avast interface.

Bottom left, click Settings. Scroll down to the "Exclusions" drop down menu, and add the file path to your self-deleting BAT files. :)

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You! You solved the issue. I was confused as to why you referenced Avast, and I checked Avast's virus vault - ALL my .bat files are there!

In my previous reply I mentioned the possibility of "malware". I was not too far off the truth. To me a virus scanner that deletes batch file without informing the user almost qualifies as malware . . .

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated January 7, 2020 Views 670 Applies to: