The following code can be used to create a folder and create an asp file(and write some contents into the file) inside the folder dynamically using asp
The below code will check if the specified foldername exists in the server, and if not create a folder and a file inside that folder.
<%
Dim objFSO ' FileSystemObject
Dim objFdr ' FolderObject
Dim ObjTS ' TextStreamObject
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if not objFSO.FolderExists(server.MapPath("/FolderName")) then
Set objFdr = objFSO.CreateFolder(server.MapPath("/FolderName"))
Set objTS = objFSO.CreateTextFile(server.MapPath("/FolderName/index.asp"), True)
objTS.Write "Sample Data" & vbcrlf
objTS.Close
Set objFdr = Nothing
end if
Set objFSO = Nothing
Set objTS = Nothing
%>