Skip to content

Instantly share code, notes, and snippets.

@brightstreetgroup
Created April 14, 2013 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brightstreetgroup/8166eb3850916a05319e to your computer and use it in GitHub Desktop.
Save brightstreetgroup/8166eb3850916a05319e to your computer and use it in GitHub Desktop.
Create new folder with Classic ASP. GHData is a network path
<%
On Error Resume Next
Response.Write("<strong>Folder Create Tester: </strong> <br/><hr>")
strFilesRootPath = "\\ServerName\Test"
intECNumber = "ShaneTest123"
strECPath = strFilesRootPath & "\" & intECNumber
Response.Write("Attempting to create folder at: " & strECPath & " (Test Run at: " & Time & ")")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Response.Write("<br/>Is objFSO a valid object? " & IsObject(objFSO))
Response.Write("<br/>Does Folder Exist? " & objFSO.FolderExists(strECPath))
Response.Write("<hr>")
If NOT objFSO.FolderExists(strECPath) Then
Response.Write("<br/>Attempting to Create Folder... <strong>" & strECPath & "</strong>")
objFSO.CreateFolder(strECPath)
If Err.Number <> 0 Then
Response.Write("<br/><br/><span style='color:red'>Error Creating Folder!")
Response.Write("<br/>Number: <strong>" & Err.Number & "</strong>")
Response.Write("<br/>Description: <strong>" & Err.Description & "</strong>")
Response.Write("<br/>Source: <strong>" & Err.Source & "</strong>")
Response.Write("</span><br/>")
Err.Clear
Else
Response.Write("<br/><span style='color: green'>The Folder Created successfully. </span><br/>")
End If
Response.Write("<hr><br/>Test Completed.")
End If
Set objFSO = Nothing
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment