’ -------------------------------- ’ 自动创建指定的多级文件夹 ’ strPath为绝对路径 Function AutoCreateFolder(strPath) ’ As Boolean On Error Resume Next Dim astrPath, ulngPath, i, strTmpPath Dim objFSO If InStr(strPath, "\") <=0 Or InStr(strPath, ":") <= 0 Then AutoCreateFolder = False Exit Function End If Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strPath) Then AutoCreateFolder = True Exit Function End If astrPath = Split(strPath, "\") ulngPath = UBound(astrPath) strTmpPath = "" For i = 0 To ulngPath strTmpPath = strTmpPath & astrPath(i) & "\" If Not objFSO.FolderExists(strTmpPath) Then ’ 创建