PC Review


Reply
Thread Tools Rate Thread

How to loop thru all the files in a folder ?

 
 
fniles
Guest
Posts: n/a
 
      16th Apr 2007
I would like to loop thru all the files in a folder. For ex: I have a folder
c:\temp and inside that folder there are many zip files. I want to read each
zip files in c:\temp.
How can I do that ?
Thank you.


 
Reply With Quote
 
 
 
 
rowe_newsgroups
Guest
Posts: n/a
 
      16th Apr 2007
On Apr 16, 9:59 am, "fniles" <fni...@pfmail.com> wrote:
> I would like to loop thru all the files in a folder. For ex: I have a folder
> c:\temp and inside that folder there are many zip files. I want to read each
> zip files in c:\temp.
> How can I do that ?
> Thank you.


Something like:

for each file as System.IO.File in System.IO.Directory.GetFiles("C:
\temp", "*.zip")
' Do Something
end for

Thanks,

Seth Rowe

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      16th Apr 2007
"rowe_newsgroups" <(E-Mail Removed)> schrieb:
>> I would like to loop thru all the files in a folder. For ex: I have a
>> folder
>> c:\temp and inside that folder there are many zip files. I want to read
>> each
>> zip files in c:\temp.
>> How can I do that ?
>> Thank you.

>
> Something like:
>
> for each file as System.IO.File in System.IO.Directory.GetFiles("C:
> \temp", "*.zip")
> ' Do Something
> end for



\\\
Imports System.IO
....
For Each FileName As String In Directory.GetFiles("C:\temp", "*.zip")

Next FileName
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop thru folder looking for files with date code in name John Keith Microsoft Excel Programming 7 28th Sep 2009 06:23 PM
Loop through files in a folder and unprotect sheets Diddy Microsoft Excel Programming 13 15th Aug 2008 10:59 AM
How to loop through excel files in folder =?Utf-8?B?ZmFiZXJr?= Microsoft Access Form Coding 8 7th Jun 2006 11:38 PM
Loop thru All Files in a Folder Juan Sanchez Microsoft Excel Programming 3 5th Jul 2004 07:38 PM
Loop through all files in a folder Fred Smith Microsoft Excel Programming 4 7th Jun 2004 01:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 AM.