I haven't tried it but this looks like exactly what you're looking for: CreateFolderEx (extended CreateFolder command)