473,422 Members | 1,789 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,422 software developers and data experts.

Copying root directory

G'day ppl

Is there a process whereby I can copy the text labels of all the files in a
root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark
Dec 17 '05 #1
16 2409

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark


Mark, I think you might have posted this to the wrong newsgroup. This group
is for support of Microsoft Access, the desktop database application.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Dec 17 '05 #2
G'day Randy & thx for your reply.

Totally aware of the NG, my dilemma is that I want to import the root
directory file labels into a table, hence the reason I am posting in an
access forum.

Cheers.
Mark.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 17 '05 #3
I think your looking for something like

dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
debug.print strname
strname = dir
loop

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in
a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark

Dec 17 '05 #4
Oops, sorry. Bad assumption on my part.

The code that Terry provided should do nicely, just substitute an insert for
the debug.print.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
"Mark Lind" <no******@iprimus.com.au> wrote in message
news:q3************@news.uswest.net...
G'day Randy & thx for your reply.

Totally aware of the NG, my dilemma is that I want to import the root
directory file labels into a table, hence the reason I am posting in an
access forum.

Cheers.
Mark.

*** Sent via Developersdex http://www.developersdex.com ***


Dec 17 '05 #5
Thx Randy & Terry

Although Terry, code did not work, though I have no idea if I did it correct
or not.

I paste the code behind the OnClick of a cmdbtn but zip happened.

here's the deal:

Using this code, I would like it to collect the info that is displayed in
the explorer view of a folder.

this info would be:
Name/Size/Type/Duration..........etc...etc..
I am building a jukebox/library of all the mp3/mpeg/dvd I have on my system,
and don't really want to have to pain stakingly input every one of them.

Thx again
Mark.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:0b********************@karoo.co.uk...
I think your looking for something like

dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
debug.print strname
strname = dir
loop

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
G'day ppl

Is there a process whereby I can copy the text labels of all the files in
a root directory?

I recall going back a long way seeing something about it but did not take
any notice as I didn't think I would ever use it.

TIA
Mark


Dec 18 '05 #6
Well I think you're missing where the output is going.

After you click the button press Ctrl-G on the keyboard that will take you
to the Immmediate window where you should see the file names listed.

--
Terry Kreft

"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
Thx Randy & Terry

Although Terry, code did not work, though I have no idea if I did it
correct or not.

I paste the code behind the OnClick of a cmdbtn but zip happened.>>

<SNIP>
TIA
Mark




Dec 19 '05 #7
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...

'--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing

Dec 19 '05 #8
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
'--specify where the information is going to go...

dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing

Dec 19 '05 #9
sorry, that's what happens when you write off the top of your head in
notepad...

Dec 19 '05 #10
Don't I know it <g>.

..MoveNext the bane of my life. If I get a bug in a recordset iteration it's
because I've missed that line by typing faster than I can think (and I don't
type fast <g>).

--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
sorry, that's what happens when you write off the top of your head in
notepad...

Dec 20 '05 #11
Terry & Piet.

Firstly, Seasons greetings to both you and your families.

Thank you so much, between the 2 of you I managed to piece it together.

I would like to go 2 steps further if you can assist:

I think this is a big ask & will test you.. :-)

1. I need to copy a portion of text from 1 field to another. eg "Tom Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop fashion
to do all records that match this type of criteria.

2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the windows
explorer.

Thx again.

TIA
Mark.
"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the
recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...

dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing


Dec 22 '05 #12
I managed to fix no.1 by parsing the text using Left$ & Right$, so thats
cool.

thx again
Mark
"NoodNutt" <no******@iprimus.com.au> wrote in message
news:43********@news.iprimus.com.au...
Terry & Piet.

Firstly, Seasons greetings to both you and your families.

Thank you so much, between the 2 of you I managed to piece it together.

I would like to go 2 steps further if you can assist:

I think this is a big ask & will test you.. :-)

1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones - She's A Lady"... I would like to cut "Tom Jones - " delete the 2
spaces & dash then paste "Tom Jones" into the new field, structured in a
loop fashion to do all records that match this type of criteria.

2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows explorer.

Thx again.

TIA
Mark.
"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except

do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update

strname = dir ' Get thye next one after you've written to the
recordset
loop


--
Terry Kreft

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)

'--Borrowed from Terry Kreft...
dim strName as string

strname = Dir("c:\*.*")

do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop

rs.close
set rs=nothing



Dec 22 '05 #13

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the windows
explorer. "Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop <pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
'--Borrowed from Terry Kreft...
dim strName as string
strname = Dir("c:\*.*")
do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop
rs.close
set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 22 '05 #14
G'day chuck,

Thx for replying, I actually have imported all the file names already, I was
hoping there was a way of extracting the tagged info that accompanies mp3
files.

unless there is another program that can store tag info & export in
tab/comma delimited.

thx again.
Mark

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com...

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop <pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've done this... essentially all you need to do inside the loop is
indicate where the data is going...
> '--specify where the information is going to go...
dim rsFiles as DAO.recordset
set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
'--Borrowed from Terry Kreft...
dim strName as string
strname = Dir("c:\*.*")
do while len(strname) > 0
'debug.print strname
strname = dir
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
loop
rs.close
set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 23 '05 #15

Check out the Tag & Rename program. It will do exactly that!

http://www.softpointer.com/tr.htm

I think it's about $25.

If you want to do it all inside Access, there are a couple of MP3
class files on the web that can do this, but the tag&rename program is
a lot nicer to use, and has a bunch of nice features already built-in
that you won't have to program in.

I have the Tag&&Rename program myself (I'm a user, I didn't write it)
and use it for editing the tags and exporting the tag information to a
CSV, then I import the data into my MP3 Database in Access/SQL.

I spent quite a bit of time doing it all myself with my own code, but
in the end it was just easier and simpler to do it with the Tag&Rename
program (which will also link up with a couple of CD Libraries on the
web and grab information for you.)

On Fri, 23 Dec 2005 20:30:49 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thx for replying, I actually have imported all the file names already, I was
hoping there was a way of extracting the tagged info that accompanies mp3
files.
unless there is another program that can store tag info & export in
tab/comma delimited. "Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com.. .

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces &
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
Whoops, slight error there piet. It should be as below except
do while len(strname) > 0
'debug.print strname
'--Write to table...
rs.AddNew
rs.Fields("FileName")=strname
rs.Update
strname = dir ' Get thye next one after you've written to the
recordset
loop

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
> I've done this... essentially all you need to do inside the loop is
> indicate where the data is going...
> > '--specify where the information is going to go...
> dim rsFiles as DAO.recordset
> set rsFIles = DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
> '--Borrowed from Terry Kreft...
> dim strName as string
> strname = Dir("c:\*.*")
> do while len(strname) > 0
> 'debug.print strname
> strname = dir
> '--Write to table...
> rs.AddNew
> rs.Fields("FileName")=strname
> rs.Update
> loop
> rs.close
> set rs=nothing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 23 '05 #16
Thx heaps chuck, I'll get strait on it after my new year hangover.

reg's
Mark.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:7m********************************@4ax.com...

Check out the Tag & Rename program. It will do exactly that!

http://www.softpointer.com/tr.htm

I think it's about $25.

If you want to do it all inside Access, there are a couple of MP3
class files on the web that can do this, but the tag&rename program is
a lot nicer to use, and has a bunch of nice features already built-in
that you won't have to program in.

I have the Tag&&Rename program myself (I'm a user, I didn't write it)
and use it for editing the tags and exporting the tag information to a
CSV, then I import the data into my MP3 Database in Access/SQL.

I spent quite a bit of time doing it all myself with my own code, but
in the end it was just easier and simpler to do it with the Tag&Rename
program (which will also link up with a couple of CD Libraries on the
web and grab information for you.)

On Fri, 23 Dec 2005 20:30:49 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thx for replying, I actually have imported all the file names already, I
was
hoping there was a way of extracting the tagged info that accompanies mp3
files.
unless there is another program that can store tag info & export in
tab/comma delimited.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:32********************************@4ax.com. ..

Mark, Are you trying to read in the MP3 tags off of MP3 files, or are
you using the file names themselves?

On Thu, 22 Dec 2005 21:42:04 +1100, "NoodNutt"
<no******@iprimus.com.au> wrote:
Thank you so much, between the 2 of you I managed to piece it together.
I would like to go 2 steps further if you can assist:
I think this is a big ask & will test you.. :-)
1. I need to copy a portion of text from 1 field to another. eg "Tom
Jones -
She's A Lady"... I would like to cut "Tom Jones - " delete the 2 spaces
&
dash then paste "Tom Jones" into the new field, structured in a loop
fashion
to do all records that match this type of criteria.
2. It would save me literally months of data entry if there was a way of
copying the "tag info" of each file, that which is displayed in the
windows
explorer.

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:1E********************@karoo.co.uk...
> Whoops, slight error there piet. It should be as below except
> do while len(strname) > 0
> 'debug.print strname
> '--Write to table...
> rs.AddNew
> rs.Fields("FileName")=strname
> rs.Update
> strname = dir ' Get thye next one after you've written to the
> recordset
> loop

> <pi********@hotmail.com> wrote in message
> news:11**********************@o13g2000cwo.googlegr oups.com...
>> I've done this... essentially all you need to do inside the loop is
>> indicate where the data is going...
>> > '--specify where the information is going to go...
>> dim rsFiles as DAO.recordset
>> set rsFIles =
>> DbEngine(0)(0).OprenRecordset("MyDestTable",dbOpen Table)
>> '--Borrowed from Terry Kreft...
>> dim strName as string
>> strname = Dir("c:\*.*")
>> do while len(strname) > 0
>> 'debug.print strname
>> strname = dir
>> '--Write to table...
>> rs.AddNew
>> rs.Fields("FileName")=strname
>> rs.Update
>> loop
>> rs.close
>> set rs=nothing
--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Dec 30 '05 #17

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

Similar topics

4
by: Jacob | last post by:
Really more of a VS.NET question than a C# question.... I have a couple files in my solution that I would like copied to the compile directory when the solution is built. How do I set it up so...
5
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following...
4
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
4
by: zMisc | last post by:
Is it possible to copy a table from one schema to another schema by just copying the frm file to the directory for the new schema? What is the best way to create a new database with all the...
17
by: Michael | last post by:
Hello, I am writing an app that will sit on the desktop. It needs to be able to make a copy of a folder that sits on the server. It will copy the folder from the server and place it in the same...
8
by: news.microsoft.com | last post by:
I have two completely distinct ASP.NET (2.0) web applications. They share no code, they have distinct web.config files, they don't even link to each other. During development, they have lived...
4
by: supriyamk | last post by:
Hi, I am trying to search a directory for subdirectories, recreate the subdirectories elsewhere and copy only certain files from current subdirectory to new subdirectory. In other words i am...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
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...
0
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...

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.