To get the relevant error message:
- Convert 2147942667 to hex: 8007010B
- Take last 4 digits (010B) and convert to decimal: 267
- In a Command Prompt, run
net helpmsg 267
- Result: “The directory name is invalid.”
The solution for me was that I had quotes in the “Start In” field. I found this information in Microsoft KB Article 2452723, Windows Vista onward scheduled tasks fail to run if the path in “Start in (Optional)” field has quotes.
Basically, edit your scheduled task and take the quotes out of the “Start In” field:
- Open your Scheduled Task
- Switch to “Actions” tab
- Open your Action
- Remove Quotes (“) from the field “Start in (optional)”
- Save and close all open dialogs
You should also check for other causes of the error, like not having permission to access the directory, or using a mapped drive letter which is only available during certain login sessions.