1.
<%
Sub create(fso,path)
If fso.FolderExists(path) Then
Exit Sub
End If ’xyz 如果存在不建立
If Not fso.FolderExists(fso.GetParentFolderName(path)) Then
create fso,fso.GetParentFolderName(path)
End If xyz 如果不存在則建立
fso.CreateFolder(path)
End Sub
Set fso = CreateObject("scripting.filesystemobject")
outputf = "C:\xyz\" ’最後必須有 \ 號
set fso = Nothing
%>
2.
<%
If ReportFolderStatus("c:\ABC") = 0 Then CreatFolder() '假如C:\ABC文件夾不存在
Function ReportFolderStatus(FolderDir)
Dim Fso, Status
Set Fso = CreateObject("Scripting.FileSystemObject")
If (Fso.FolderExists(FolderDir)) Then
Status = 1
Else
Status = 0
End If
ReportFolderStatus = Status
End Function
Function CreatFolder()'建立資料夾
Dim Fso
Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Folder
Set Folder = Fso.CreateFolder("c:\ABC")'資料夾名稱c:\ABC
set fso = Nothing
End Function
%>
3.
<%
Dim fso
Set fso=Server.CreateObject("Scripting.FilesystemObject")
fso.CreateTextFile("c:\ABC")'直接建立資料夾ABC
response.write("新建文件abc")
set fso=nothing
%>
留言列表