Does anyone know how I can use the FileSystemObject object to list the folders in a drive. For example, I want to list all the folders on the c drive of my web server.
I tried using the following code, but got an error message stating that the object does not support this property or method, "Folders".
Code*************************
dim myfso, mydrive, myfolders
set myfso = server.createobject("Scripting.FileSystemObject"
if myfso.driveexits("C" then
set mydrive = myfso.getdrive("C"
for each myfolders in mydrive.folders
response.write myfolders.name & "<br>"
next
else
response.write "false"
end if
end code************************
Am I using the folders collection right?
I tried using the following code, but got an error message stating that the object does not support this property or method, "Folders".
Code*************************
dim myfso, mydrive, myfolders
set myfso = server.createobject("Scripting.FileSystemObject"
if myfso.driveexits("C" then
set mydrive = myfso.getdrive("C"
for each myfolders in mydrive.folders
response.write myfolders.name & "<br>"
next
else
response.write "false"
end if
end code************************
Am I using the folders collection right?