In these examples, we will create and delete subdirectories within the Cgi-bin directory on our site. Many people often we will have permission to perform this action not only in this directory.
Create folder name "Www.111cn.net"
<%
Foldertocreate=server.mappath ("") & "/cgi-bin/myfiles"
Set fs = CreateObject ("Scripting.FileSystemObject")
Set a = fs. CreateFolder (Foldertocreate)
Set fs=nothing
%>
Done
Delete File "Www.111cn.net"
<%
Foldertodelete=server.mappath ("") & "/CGI-BIN/111CN"
Set fs = CreateObject ("Scripting.FileSystemObject")
Fs. DeleteFolder (Foldertodelete)
Set fs=nothing
%>
Done
Delete the folder, and then delete the file when it exists.
<%
Foldertodelete=server.mappath ("") & "/cgi-bin/myfiles"
Set fs = CreateObject ("Scripting.FileSystemObject")
If Fs. FolderExists ("C:temp") Then
Fs. DeleteFolder "C:temp"
End If
Set fs=nothing
%>
Done
Www.111cn.net