Function MD(strDirName) Dim lFSObj, lFolder ' First See if it already exists set lFSObj = Wscript.CreateObject("Scripting.FileSystemObject") set lFolder = lFSObj.GetFolder(strDirName) If Err.number = 0 then ' Yes, it does exist so we don't have to do anything MD = True Else Err.Clear lFSObj.CreateFolder(strDirName) If Err.Number <> 0 Then MD = False Else MD = True End If End If Set lFolder = Nothing Set lFSObj = Nothing End Function