vb Create a folder

Sub CreateFolder(strFolderName)
	Dim filesystem
	Dim folder

	If strFolderName <> "" Then
		strFolderName = Server.Mappath(strFolderName)
		Set filesystem = Server.CreateObject("Scripting.FileSystemObject")
		
		If filesystem.FolderExists(strFolderName) Then
			Response.Write "

Folder " & strFolderName & " already exists!

" Else Set folder = filesystem.CreateFolder(strFolderName) Response.Write "

Folder " & strFolderName & " has been created!

" End If Set folder = nothing Set filesystem = nothing Else Response.Write "

Please enter a folder name!

" End If End Sub
Use for creating a folder on the server's file system - will require setting the appropriate permissions.

Updated: Saturday 2nd October 2010, 14:53am

There are 0 comments

Leave a comment of your own

Comments are currently closed.