Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file system object....listing files in directory?

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
Hi, I would like to create a page for users to see files in my directory but don't want them to see everything which is why I don't want to allow the browse button. I'd like set myself what type of files they can view and/or work with such as .txt, .html, .doc, etc.

Do you know if there is a way to list files and/or objects in a directory, and if so, how to specify which ones Can be seen, or which ones specifically Can Not be seen?

Thanks in advance... -Ovatvvon :-Q
 
ok the following code, will produce a list of all the files in a specified directory on your harddrive.....

***************************************************
Dim filesys, drv, fl, s, rootdir, rootfiles, fileobj, name, size, total, filesy, txtfile, line
Dim Drivelet
drivelet = "F"
set filesys = createobject("Scripting.Filesystemobject")
set drv = filesys.getdrive(drivelet)
set rootdir = drv.rootfolder
set rootfiles = rootdir.subfolders
for each fileobj in rootfiles
name = fileobj.name


***************************************************

for which files people can use you will have to sort that from another way, i would suggest using something with the above code like

if name = "(name of file)" then (code to open)

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top