Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Methods
FileSystemObject Object
METHOD: FileSystemObject.CreateFolder
Implemented in version 2.0
object.
CreateFolder
foldername
This method allows us to create a folder with the specified
foldername
.
If a folder already exists with the same name as you are trying to create, you will get an error. The
FolderExists
method can be used to check this before creating you new folder.
(Note that the "c:\DevGuru" folder must exist before you can add the "\myfolder" folder.)
Code:
<%
dim filesys, newfolder, newfolderpath
newfolderpath = "c:\DevGuru\myfolder"
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
Response.Write("A new folder has been created at: " & newfolderpath)
End If
%>
Output:
"A new folder has been created at: c:\DevGuru\myfolder"
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information