The FileSystemObject has a collection property called Drives. Each drive in the drives collection has a RootFolder object. Each Folder (including the RootFolder) has a subfolders collection and a Files collection.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact Advertise on Bucaro TecHelp Advertise Here RSS News Feeds News Feeds


Hello World! Computer Programming for Kids and Other Beginners

Hello World! Computer Programming for Kids and Other Beginners

This book provides a gentle but thorough introduction to computer programming. It's written in language a kid can follow, but anyone who wants to learn how to program a computer can use it. Even adults.

Teaches using the powerful object-oriented but easy-to-use open source Python programming language.

Click Here

Working With Folders in ASP

When ASP is installed, the FileSystemObject is automatically installed with it. The FileSystemObject allows you to work with drives, folders, and files on the server.

The FileSystemObject has a collection property called Drives. A collection is a list or array of objects of the same type. Each drive in the drives collection has a RootFolder object. Each Folder (including the RootFolder) has a subfolders collection and a Files collection.

Drives Collection

In certain instances, you may not be sure that a specific drive exists. In that case, you should use the "DriveExists" method of the FileSystemObject before attempting to access the drive. Example code for this is shown below.

<%
Dim objFS

Set objFS = _
  Server.CreateObject("Scripting.FileSystemObject")
If objFS.DriveExists("c:") = true then
  Response.Write("Drive Exists")
Else
  Response.Write("Drive Doesn't Exist")
End If
Set objFS = Nothing
%>

The drive that you are attempting to access might be a removable storage unit. In that case, you should check the Drive objects IsReady property to make sure the removable media is installed before attempting to access the drive. Example code for this is shown below.

<%
Dim objFS, Drv

Set objFS = _
  Server.CreateObject("Scripting.FileSystemObject")
Set Drv = objFS.GetDrive("c:")

If Drv.IsReady = True Then
  Response.Write("Drive Ready")
Else
  Response.Write("Drive Not Ready")
End If
Set Drv =  Nothing
Set objFS = Nothing
%>

Programming Sections

RSS Feed RSS Feed

Active Server Pages


[Site User Agreement] [Advertise on This site] [Search This Site] [Contact Form]
Copyright©2001-2011 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268