Windows Task Scheduler: The directory name is invalid. (0x8007010B)

Ran into an interesting little problem this morning with getting a job to run in the Task Scheduler of a Windows Server 2008 server with Service Pack 2 installed.

Every time I tried to run the job I would get the error message “The directory name is invalid. (0x8007010B)”.

In looking at the Actions for this Task the “Start in (optional)” field was filled in with the correct path name:

“C:\Program Files (x86)\BLAH\”

I thought it might be the trailing backslash problem, so I removed it.  Same error message.

Turns out it is the quotes that are causing the problem here as the “Start in (optional)” field just doesn’t support them.  Take out the quotes and your task should run just fine.  You can set this directory with or without the trailing backslash and it will still work.

Here’s what my corrected Action looks like in the Task Scheduler.

Corrected Task Scheduler Job

Task Scheduler Job with Corrected "Start In (optional)" field

50 thoughts on “Windows Task Scheduler: The directory name is invalid. (0x8007010B)”

  1. THANK YOU!

    I was banging my head against Task Scheduler for ages until I came across this post.

  2. thank you so much for this. for the past few days i’ve been racking my brain over this issue i’ve been having, and it was such a simple solution thanks to you. thanks again.

  3. Thanks, just like others I have been banging my head on this. Windows just sucks. Cronjobs are so better and easier on linux.

  4. THANK YOU
    GRACIAS !!!!

    2.5 days working on this !!!!! I was about to give up !!!! and finally Google got me here to read your blog !!!!

    Thanks!

  5. Greaat Post!! It was and it will be of BIG, REALLY BIG HELP for me and for a lot of tech people :).

    As usually, I been searching for the answer at Microsoft Technet site first, and as usually, they don’t have the correct solution!!. And it seems that the Windows 2008 TaskScheduler has a lot of anothers problems :(.

  6. Just wanted to add my thanks – easy solution to something which was really causing me a headache!

  7. Thank you! That was driving me nuts. You’d think they’d provide some way to notify you of that glaring inconsistency and save us all a lot of time.

  8. Thank You.

    Another useful suggestion is to ensure that you always run the “Task Scheduler” in the administrator mode before creating a task.

  9. Thank you much. I actually suspected this was the problem right from the start, so after seeing that error I tried putting in the directory name using the no-space tilda version (c:\progra~1\blahblahblah). That works at the command line, so when it didn’t work here I thought I must have been on the wrong track. Spent a bunch more time working on it without it ever occurring to me to try using the path with spaces but without quotes. Then I found your blog entry and was saved. Thankyouthankyouthankyou!

  10. Thank you very much for illuminating one of Microsoft’s gabillion absurdities. Helped me greatly today.

  11. Windows 7 may require something a little different which I figured out after reading your blog.
    Use the Browse button to find your program.
    Windows will then insert the location into the window with quotes.
    Highlight and cut the location, leaving just the program name behind.
    Paste the location into the “Start in” window.
    Remove the quotes.
    It will look like this.

    Program/Script trillian.exe
    Start in C:\Program Files (x86)\Trillian

    Save exit, and right click to run the program. Task scheduler should report operation successful.

  12. Thank you – wouldn’t have dreamed that the spaces in the path would be handled correctly so you saved me a ton of time.

  13. Two years after you posted this, you are still saving the day. There’s no way I would’ve thought of removing quotes on an explicit path that has spaces on a Windows box. Great info.

  14. Thank you!!! Didn’t think the quotes would cause a problem since I left them in there for W2k3 all the time. This saved a lot of headache.

  15. Thanks for the info. Fixed my issue. Was going crazy trying to figure what’s wrong with the scheduled task..

  16. I hope this works. Been racking my brain with this for a couple months. I re-wrote my custom scripts to match what others were having issues with. Changes permissions thinking that was it. Dropped the path in the “start in” field but it had quotes so it failed. So now i removed them and I hope it works. Unfortunately i have to wait till Monday to verify because what I am doing its a once a day task and if it doesn’t run automatically someone does it manually and my files are gone (cant upload test files to an FTP server don’t have privs)

  17. I was only working on this for hours before I found your post. Thanks so much.

  18. Excellent post.

    Microsoft should have fixed this bug.

    I got same error on Windows Server 2012.
    Waste so many hours on so many people is BAD BAD BAD!

  19. +1 for this. I thought software development meant that you made software better. M$ has made the task scheduler much less useful and more cumbersome, while keeping the bugs. Ahem.

  20. I followed the tip here, but that didn’t work.

    Another forum individual noted that they shortened the name of the script, so I did the same and now it works.

    Thanks Microsoft for your wonderful product.

    /s

  21. THANK YOU THANK YOU THANK YOU.

    Why Microsoft would use (require!) quotes in one field, and not use (break!) them in another field, ON THE SAME DIALOG BOX, is a mystery that only Microsoft will someday finally answer. In hell.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>