像这样的东西:
Set fs=Server.CreateObject("Scripting.FileSystemObject")
//Create folder if it doesn't exist
If fs.FolderExists("YOURFOLDERPATH") != true Then
Set f=fs.CreateFolder("YOURFOLDERPATH")
Set f=nothing
End If
//Copy your file
set fs=nothing
W3Schools 有很多关于如何使用 FileSystemObject [这里][1] 的示例。
编辑:
Set fs=Server.CreateObject("Scripting.FileSystemObject")
folders = Split("YOURFOLDERPATH", "\")
currentFolder = ""
//Create folders if they don't exist
For i = 0 To UBound(folders)
currentFolder = currentFolder & folders(i)
If fs.FolderExists(currentFolder) != true Then
Set f=fs.CreateFolder(currentFolder)
Set f=nothing
End If
currentFolder = currentFolder & "\"
Next
//Copy your file
set fs=nothing