Hi folks,
Here's what I have so far... - Dim fso, fol, subfol, fo, fls, fl, subfol2, subfol3
-
-
sSearchString = "C:\"
-
-
Set fso = CreateObject("Scripting.FileSystemObject")
-
Set fol = fso.getfolder("C:\")
-
Set subfol = fol.subfolders
-
-
-
For Each fo In subfol
-
On Error GoTo Resumeit
-
Set fls = fo.Files
-
-
'Else
-
For Each fl In fls
-
If UCase(Right((fl.Name), 3)) = "ZIP" Then
-
' MsgBox fl.Name
-
End If
-
Next fl
-
-
Resumeit2:
-
Next fo
This gets me down to one level below C:\, but I need to get to every subdirectory and pull out all the zip files that are floating around.
application.fil esearch does not recognize .zip files as files, so that trick is out.
This is as close as I've come.
Can anyone help me drill down from here? Is there a better method?
Thanks in advance.
1 1092
I have tackled this exact problem of traversing folders in the past. The technique I came up with (based largely on someone else's example, I think) is a reentrant routine - that is, one which calls itself. I'll have a dig around for some source code later. but the general method was something like this (just pseudo-code)... - Sub ProcessFolder (fld as Folder)
-
-
For each SubFolder in fld
-
ProcessFolder SubFolder
-
Next
-
-
For each File in fld
-
ProcessFile File
-
Next
-
-
End Sub
-
-
Sub ProcessFile (fil as File)
-
-
' Do whatever you want with fil here.
-
-
End Sub
Note, when writing a routine which will call itself like this, where each iteration must be separate, it's important to avoid using Static variables (unless you really know you need them)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mart Rogers |
last post by:
I have an asp.net project which includes some javascript files which live in
a subdirectory to the project root directory.
The include statements obviously expect the files to be in that
subdirectory.
I wish to debug the javascript, but when I try to add the files to the
project, they are copied into the project root directory.
I tried to 'create' a folder in Solution Explorer and hand copied the files
in there, and then tried to add...
|
by: Larry R Harrison Jr |
last post by:
I have them working now, courtesy of the link given in the prior thread--the
HVMenu over at Dynamic Drive myself.
http://www.dynamicdrive.com
I have them working as side-bar menus, not horizontal ones on TOP of the
page.
I figured it out and have it working fine, except for one thing--apparently
I need to insert the code for the menu for every last HTML file I have
|
by: TokiDoki |
last post by:
Hello there,
I have been programming python for a little while, now. But as I am
beginning to do more complex stuff, I am running into small organization
problems.
It is possible that what I want to obtain is not possible, but I would
like the advice of more experienced python programmers.
I am writing a relatively complex program in python that has now around
40 files.
|
by: RML |
last post by:
hey guys,
i am looking at this piece of code that lists numbers of files in a
directory. i want to convert it so it lists the files in th directory that
end with .doc. i cant seem to get it to output correctly, i have included
the original code, my modified code, and the output from my modifed code..
why does it list the files as "System.IO.FileInfo"???
thanks
|
by: Bennett Haselton |
last post by:
If I add this to my web.config file:
<authentication mode="Forms">
<forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All"
timeout="60" />
</authentication>
I can configure the application so that users who try to access a page
in the application, get redirected to login.aspx where they have to
sign in. (And the "signing in" is handled in the codebehind page of
| |
by: Kivak |
last post by:
Hey everyone,
I know we have to be able to do this, or Microsoft was stupid. How do
we get down to the very variables in the DataGrid and FormView? Lets
say I have a table to hold a product ID and the product name...
-----------------------
| ID: | Name: |
| 1 | MyProduct1 |
| 2 | MyProduct2 |
|
by: tim |
last post by:
Hi all!
How to create array of string, which contains names of all files with full
path in special folder (e.g. c:\windows). In this folder it may be
subfolders of various levels.
|
by: Jack Russell |
last post by:
I need to drill down from a directory through all the sub directories
and build up a list of files. I have VB6 code to do this but it uses
APIs etc and am hoping that there is a better way of doing in .net 2003
I would appreciate any help or examples that anyone can give me
Thanks
Jack Russell
|
by: Claire |
last post by:
Ive written a small string resource building utility that I send out to our
translators. I have a setup project for each language we support, which
picks
out a group of 12 english resx files plus their paired "foreign" resx for
that language only and installs those resource files in a subdirectory
somewhere.
I'm trying to create a setup project in visual studio 2008. Ive got my
Application Folder set up with my executable. Im now...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |