Print file lists

G

Guest

HI
Does anyone know how to print out file lists from Microsoft Explorer? I
would like to either print the list directly or export it to Excel for
editing.
Thanks
 
D

David Candy

Set objShell = CreateObject("Shell.Application")
Set Ag=Wscript.Arguments
set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\" & Wscript.ScriptName & "\", Chr(34) & Wscript.ScriptFullName & Chr(34)
WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\" & Left(Wscript.ScriptName, Len(Wscript.ScriptName)-3) & "exe" & "\", Chr(34) & Wscript.ScriptFullName & Chr(34)

Set Fldr=objShell.NameSpace(Ag(0))

Set FldrItems=Fldr.Items
Set fso = CreateObject("Scripting.FileSystemObject")


Set DeskFldr=objShell.Namespace(16)
FName=fso.buildpath(DeskFldr.self.path, "Folder Property List.txt")


Set ts = fso.OpenTextFile(FName, 8, vbtrue)



For x = 0 to 50
t1 = t1 & Fldr.GetDetailsOf(vbnull, x) & " (Shell)" & vbtab
Next
ts.write FLDR.self.path &vbcrlf
ts.Write T1 & vbcrlf
T1=""


For Each FldrItem in FldrItems
For x = 0 to 50
t1 = t1 & Fldr.GetDetailsOf(FldrItem, x) & vbtab
Next
t1=t1 & vbcrlf
ts.Write T1
T1=""
Next

'msgbox FName & "has a tab delimited list of all properties"


You can drag a folder from (say explorer) on to the file. You can put it in
Sendto, type sendto in Start Run, copy the file into the sendto folder, then
right click the folder you want to list, Send To, PrintDetailsAppend.
Sending To simulates a drag and drop.

Then import the file into excel, delete the columns you don't want (as most
are blank for any individual type of file, eg MP3 don't have a Date Picture
Taken and JPEGs don't have a Genre property), sort it on description and
delete the files you don't want. That will leave just the properties and
files you want. This is the most general purpose way I can think of to meet
everyones needs.

A drive is the same as a folder for these purposes.

Attached is a VBScript that generate the shell properties (what you see or
could see in Explorer). It is a 51 column csv. There is about 40 properties
on a standard XP and I've allowed about 10 columns for custom properties
that applications may add. Those whove seen it before this one automatically
finds the desktop rather than editing the script. To use, drop a folder on
it or place in Sendto and send a folder to it. If using the for command
(below) you must run it once whereever you put it so it can be found.

To do sub folders type in a command prompt in the folder that you want to
start in (It also does the parent folder - a quirk of For)
for /r %A in (.) do start "" /w "PrintDetailsAppend" "%~dpA"

It creates a file on the desktop called Folder Property List.txt
 
U

Unk

HI
Does anyone know how to print out file lists from Microsoft Explorer? I
would like to either print the list directly or export it to Excel for
editing.
Thanks

A quick and dirty way without any new software is from a DOS shell:
Click Start, Programs, DOS Prompt or click Start, Run. In the Run box, type "command.com" without
the quotes and press enter.

Navigate your way to the directory where the files are located, and use the DIR command to list the
directory and use switches to control output.
/a shows ALL files (hidden, system, etc.) dir/a
/o (letter o, not a zero) sorts them alphabetically dir/o
/s shows subdirectories dir/s
/b bare format: Just the long filename, no size, etc. dir/b
Add the command ">list.txt" to send the output to a text file "List.txt".
(Double ">>"'s makes the DIR command append the output to an existing text file)

So if you want a list of EVERY file on the C:\Music folder sent to a text file that you can edit,
then use the following command:
dir c:\music /a/b/o/s>list.txt


By 3rd party Software:

Karen's Directory Printer
http://www.karenware.com/powertools/ptdirprn.asp

Print Folder Pro:
http://no-nonsense-software.com/download.html

Print It:
http://www.skylarkutilities.com/print-it/home.html

DirPrint by Wim Heirman:
http://studwww.rug.ac.be/~wheirman/
http://studwww.rug.ac.be/~wheirman/zip/dirprt40.zip

Directory printer
http://www.galcott.com/
 
W

Wesley Vogel

What's wrong with using cmd.exe instead of command.com?

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
G

Guest

Thanks so much for taking the time to answer my query. Your reply solved my
problem!
 
W

Wesley Vogel

Ah, that explains it. I really was curious. ;-)

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
D

David Candy

So how will using command help. Seeing everything typed into command is sent to cmd for processing.
 
B

Bob I

It works, the direct access interface is what is barred. You can use
command.com to pass the commands to it and retrieve the output, but CMD
is barred from running.
 

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