Quote Originally Posted by Ellis Dee
The MakeSureDirectoryPathExists API call is a favorite of mine. Credit to Hack for first bringing it to my attention. I'd recommend it over the other API suggested because it doesn't require an hwnd.

It is worth pointing out that when you use it, your path must end with a "\".
Right, my bad, I copied the path string from the other function, looking in my code bank I see there is a backslash at the end. Funny MSDN doesn't even mention that!