File Names List - Copying Capability?

G

Guest

I'm not sure I have the correct group here. so please bare with me.

I have a plethora of jpeg files that I would like to copy the list of just
the file names over to MS Excel for purposes of printing the filenames list,
sorting and categorizing, et-cetera.

Can anyone tell me a way to do that from within Windows XP, or any other way
for that matter, without having to purchase some new additional software
package?
 
D

Dave Patrick

Give this a go.

http://support.microsoft.com/default.aspx?scid=kb;en-us;321379

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| I'm not sure I have the correct group here. so please bare with me.
|
| I have a plethora of jpeg files that I would like to copy the list of just
| the file names over to MS Excel for purposes of printing the filenames
list,
| sorting and categorizing, et-cetera.
|
| Can anyone tell me a way to do that from within Windows XP, or any other
way
| for that matter, without having to purchase some new additional software
| package?
| --
| Thanks,
| Ken
 
G

Guest

Dave,
Thanks, that works! However, I would first like to copy the directory
listing into MS Excel or Word for manipulation, then print from there.

Is there a way to get the listing copied over into Excel or some other
program for editing BEFORE printing?
 
G

Guest

Dave,

It appears to copy the listing to notepad during the printing process, but
closes notepad immediately after it sends it to spool.

If there is a way to keep it from printing then closing notepad, perhaps I
could at least copy the listing from there.

Can you offer any further tips on this?
 
G

Guest

Also, is there to limit the copying to just the filenames and not the
complete listing?
 
D

Dave Patrick

Change it to read;

@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad "%temp%\Listing"

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Dave,
|
| It appears to copy the listing to notepad during the printing process, but
| closes notepad immediately after it sends it to spool.
|
| If there is a way to keep it from printing then closing notepad, perhaps I
| could at least copy the listing from there.
|
| Can you offer any further tips on this?
| --
| Thanks,
| Ken
 
D

Dave Patrick

Put this code in a new module in your excel workbook.

Public Function ShowFileList(folderspec)
Dim fso, f, f1, fc, myrow
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
myrow = 1
For Each f1 In fc
Sheets("sheet1").Range("A" & myrow) = f1.Name
myrow = myrow + 1
Next
End Function

Public Sub GetFileNames()
ShowFileList "C:\"
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Also, is there to limit the copying to just the filenames and not the
| complete listing?
| --
| Thanks,
| Ken
 
G

Guest

Thanks Dave!

That gets me close enough to my desired result. From notepad I can delete
the top and bottom directory related stuff. Then, once I import it into
Excel, I can strip out all the columns I don't need.

Merry Christmas and Happy New Year!!
 
G

Guest

WOW! I really appreciate you going the extra mile on this with me.

However, I think you lost me a bit. I created the new macro in Excel with
the code you gave me, and when I executed it, a list appears in the first
twelve cells in the workbook. They are:
boot.ini
CONFIG.SYS
drwtsn32.log
filename.txt
IO.SYS
LogiSetup.log
MDacLog.txt
MSDOS.SYS
net_save.dna
NTDETECT.COM
ntldr
pagefile.sys

I don't get it. Should I be doing something more also?
 
G

Guest

OOps! Do I need to place the path to the directory in the (folderspec)
parenthesis or something in the code?
 
D

Dave Patrick

Run GetFileNames()


ShowFileList "C:\"

(change the argument "C:\" to the directory you want a list of.)

You can add a windows form with a text box (for the path argument) and
command button (to execute)

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| WOW! I really appreciate you going the extra mile on this with me.
|
| However, I think you lost me a bit. I created the new macro in Excel with
| the code you gave me, and when I executed it, a list appears in the first
| twelve cells in the workbook. They are:
| boot.ini
| CONFIG.SYS
| drwtsn32.log
| filename.txt
| IO.SYS
| LogiSetup.log
| MDacLog.txt
| MSDOS.SYS
| net_save.dna
| NTDETECT.COM
| ntldr
| pagefile.sys
|
| I don't get it. Should I be doing something more also?
| --
| Thanks,
| Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top