473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FileSystem Object - Iterating through a directory and building the path

Hi all ..

I have a directory with several subdirectories and a number of files in
each.
These files are accessed by going to a web page and clicking in a listbox
and navigating to the desired file.

Currently, when a new file is added to one of the sub directories, a new
link must be added to the web
page to add the new file to the listbox ... yes .... a very manually
intensive process!

I believe that I can replace this existing process with a dynamic one using
the File System Object but I could
use a little help thinking it through.

I need to display the file name (without the extention) in the listbox and I
need to build the path to the
file to be used as the Option Value in the listbox.

i.e.
<Option
value=file://servername/directory/subdirectory/subdirectory/subdirectory/fil
ename

I need two loops ... looping through the Folder Collection and through the
File collection. Do I nest them?
And how do I capture the path as it's building?

Thanks for any help and any direction !
- lise
Jul 19 '05 #1
1 5381
"Lise" <sc*******@snet.net> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
I believe that I can replace this existing process with a dynamic one using the File System Object but I could
use a little help thinking it through.

I need to display the file name (without the extention) in the listbox and I need to build the path to the
file to be used as the Option Value in the listbox.

i.e.
<Option
value=file://servername/directory/subdirectory/subdirectory/subdirectory/fil ename

I need two loops ... looping through the Folder Collection and through the
File collection. Do I nest them?
And how do I capture the path as it's building?


First, make sure you surround the option value with double quotes. As in:
<option value="...">

Next, you will probably want a function to handle the iteration, since you
want this to be dynamic. This function should take 1 or 2 parameters, the
path of the folder and perhaps a string to accumulate the filenames. This
function should create a FileSystemObject, then GetFolder of the path that
was passed in. Next, get the SubFolders. For Each subfolder in
foldercollection
' call the function again
Next
' Append the files in this folder to the input string (or print them if you
don't pass the string)

I wish I had time to go into more detail, but this is as much help as I can
be for now. Gotta run. Hope this helps some.
Regards,
Peter Foti


Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Peter Hansen | last post by:
The term "mock filesystem" refers to code allowing unit or acceptance tests to create, read and write, and manipulate in other ways "virtual" files, without any actual disk access. Everything is...
2
by: stuart | last post by:
Hi, I am trying to access remote directories using the filesystemobject and ASP. This only seems to work when the security is set to anonymous. However, I want to connect to the remote server...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
2
by: Matthias | last post by:
Hi, I am currently writing a gtkmm component which acts as a file browser, much like a small filemanager which can be embedded in gtkmm applications as a scrolled window. I have just...
4
by: Ben Fidge | last post by:
Hi What is the most efficient way to gather a list of files under a given folder recursively with the ability to specify exclusion file masks? For example, say I wanted to get a list of all...
8
by: Daz | last post by:
Hi Everyone. I am sturggling trying to find out a way in which I can delete a 'path' object. I may not need to delete it, however, I need to overwrite it. The function I am trying to code,...
5
by: GaryE | last post by:
Hello: I am having trouble linking a couple of files using the boost::filesystem. I am using MSVC 6.0. Here is an abbreviated version of my problem: foo.h: #ifndef __FOO_ #define...
2
by: Javier | last post by:
Hello all, I'm trying to remove a hidden file (in UNIX) using the Boost::filesystem library. This is what I have: #include <boost/filesystem/operations.hpp> namespace...
1
by: mfsiddiq | last post by:
HI i am trying to connect my java client to Microsoft active directoy using secure ssl,but when i try enable ssl support i get the following error but it works fine with apache studio,which is a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.