Had a strange one happen today. We recently replaced an old Windows 2003 server with a new Server 2012 R2 server. Everything was going great until we recreated the scheduled tasks. One of the tasks was failing instantly every time it starts. The error message was:
“The Directory Name is Invalid”
After checking permissions for the domain account the task runs as, checking the various settings of the task, verifying the executable path is correct, and that the executable works when run manually as that user, I was out of ideas. Time to check Google.
Turns out the optional setting for the “Action” aspect of the task doesn’t like quotes. After removing the quotes from that field, the task worked fine.