2

In Windows 7 x64 I am attempting to create a scheduled task that runs a PowerShell script, but no matter what I try, it fails with the error: "The system cannot find the file specified."

And then I noticed that many other scheduled tasks (Google updater, MS Office stuff, etc) were all failing with the same error.

So I simplified things, and created a straightforward task that does nothing more than run notepad:

  • General Tab

General Tab

  • Triggers Tab = No triggers.

  • Actions Tab

Actions Tab

  • Conditions Tab

Conditions Tab

  • Settings Tab

Settings Tab

When I run this task, I get the same error, "The system cannot find the file specified. (0x80070002)"

I have confirmed that notepad.exe exists in the c:\windows\system32 location, and that it is a working executable. In fact, all of the tasks that are failing with that error appear to have legit paths and executables.

This makes me think there is something bigger at work here, like a hosed task scheduler, maybe a Windows Update patch that mucked about with the task scheduler workings.

What could cause this, and/or what are my next troubleshooting steps?

  • Have you tried monitoring it with procmon? (docs.microsoft.com/en-us/sysinternals/downloads/procmon) – marsh-wiggle Jan 15 at 15:01
  • I filtered ProcMon to display events related to the process of ID of the scheduler process. When I run my notepad.exe task, I do see a bunch of entries (mostly file creates/closes and QuerySecurtyFile events) and although there are some buffer overflows I don't think that is the issue. Nothing else looks problematic. – Shoeless Jan 15 at 19:37
  • Is there any valuable information in the event log? – montonero Jan 16 at 9:17
  • @montonero: Nothing helpful that isn't already listed on the history tab for the task... which is also not very illuminating. – Shoeless Jan 16 at 13:48
2

Since there is no answer at all, I answer how I would break it down:

  • create the task with a uniqe name
  • run procmon.exe
  • search for the name of the task (you will find a svchost.exe)
  • rightcklick PID (process ID) and choose include ...
  • disable Show registry activity in the menubar
  • choose Tools \ count occurances
  • Select result in Column and klick count
  • There should be NAME NOT FOUND value, doublecklick it to filter only this result
  • Check the filtered events

enter image description here

  • This is very helpful- I am in an all-day meeting today but will attempt this troubleshooting as soon as I can, thank you. – Shoeless Jan 16 at 13:47
  • @Shoeless Tell us when you found the solution. – marsh-wiggle Jan 16 at 19:23
  • YOU are the man, @marsh-wiggle. Not only have I learned some new (to me) capabilities of the ProcMon utility, but I discovered that the reason my jobs were failing is because the task engine service itself (taskeng.exe) was missing from my system! I ran SFC /scannow and it replaced the critical system files, and now my tasks are running as expected. Thank you! – Shoeless Jan 16 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.