For example: \\networkshare\dir1\dir2\dir3\dir4 where the \\networkshare\dir1 already exists returns a "The directory or file cannot be created." error message. If I create each directory, dir2, then dir3 and finally dir4 individually everything works fine.
So what I'd like to do, short of them fixing it on the server side, is to create a function in my script that I can call that will check to see if each individual directory exists and if not, then create it. I thought that the "for /r" loop would be a place to start but so far I've not
pseudo code:
Passing a UNC path as an argument e.g. \\networkshare\dir1\dir2\dir3\dir4
Code: Select all
loop through each directory (
check to see if it exists
if not, create it
otherwise loop
)
Any ideas would be greatly appreciated!