listing ALL files on hard drive?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can you list ALL the files on your computer in a single list that you can
sort and/or edit using Excel and that includes file size and location, etc.?

(This was easy in the old MS DOS days, but a way to do this in Windows
eludes me. I don't know how to get My Computer or Windows Explorer to show me
the whole tree of files, and their displays can't be cut and pasted or
otherwise edited and saved. Am I missing something obvious. . . ?)

I'm using Windows XP Pro and Office Pro.

In advance, thank you.
 
I don't know about your computer, but on my main computer I would have to
list over 1.1 million files (at last count). That's how many are scanned
during my weekly AntiVirus scan (give or take a few thousand).

--


Regards,

Richard Urban
Microsoft MVP Windows Shell/User

Quote from George Ankner:
If you knew as much as you think you know,
You would realize that you don't know what you thought you knew!
 
W3 said:
How can you list ALL the files on your computer in a single list that you can
sort and/or edit using Excel and that includes file size and location, etc.?

(This was easy in the old MS DOS days, but a way to do this in Windows
eludes me. I don't know how to get My Computer or Windows Explorer to show me
the whole tree of files, and their displays can't be cut and pasted or
otherwise edited and saved. Am I missing something obvious. . . ?)

I'm using Windows XP Pro and Office Pro.

In advance, thank you.

I'd love to have the paper contract for that project.
 
How about running this from the command prompt:

dir /a:hs > c:\temp\MyList.txt

The list will be in c:\temp under the name of MyList.txt. this can then
be imported in excel.

hth
 
If you want all the subdirectories as well then do this:

dir /s > c:\temp\MyList.txt

You can also insert attributes to get hidden and systems files.

hth
 
W3 tal fulano 1 said:
How can you list ALL the files on your computer in a single list that you
can
sort and/or edit using Excel and that includes file size and location,
etc.?

(This was easy in the old MS DOS days, but a way to do this in Windows
eludes me. I don't know how to get My Computer or Windows Explorer to show
me
the whole tree of files, and their displays can't be cut and pasted or
otherwise edited and saved. Am I missing something obvious. . . ?)

I'm using Windows XP Pro and Office Pro.

In advance, thank you.

When it can't be done in Windows, use DOS (and ignore the Microsoft
sycophants who parrot "There is no DOS." CMD.EXE emulates DOS in NT+, and if
it walks like a duck and talks like a duck...)

run CMD.EXE and at the prompt, type

dir /s d:\>filename.txt

There ARE hidden and system files that this method won't detect (you could
add the /a:h or /a:s switches if you're worried about these - type
DIR/?
at the prompt for more data) but if you're serious about "every file" and
you want to select the data delivered to a .CSV file, then try

for /f %i in ('dir /s/b d:\') do echo "%~fi","%~ti","%~zi">filename.csv

try
FOR /?
from the prompt for the "~" modifiers.
* ~f (full filename) was only introduced with XP, IIRC. ~dpnx will produce
the full path should ~f be unavailable.

(This will take a while to run though....)

* Change each "%" to "%%" to execute as a line of a batch file if required

Type
EXIT
to quit CMD.EXE

More batch techniques discussion : alt.msdos.batch.nt (for NT/2K/XP) or
alt.msdos.batch (for DOS/9x)

HTH

....Bill
 
W3 said:
How can you list ALL the files on your computer in a single list
that you can sort and/or edit using Excel and that includes file size and
location, etc.?
(This was easy in the old MS DOS days, but a way to do this in
Windows eludes me. I don't know how to get My Computer or Windows
Explorer to show me
the whole tree of files, and their displays can't be cut and
pasted or otherwise edited and saved. Am I missing something
obvious. . . ?)
I'm using Windows XP Pro and Office Pro.

In advance, thank you.
When it can't be done in Windows, use DOS (and ignore the Microsoft
sycophants who parrot "There is no DOS." CMD.EXE emulates DOS in
NT+, and if it walks like a duck and talks like a duck...)

run CMD.EXE and at the prompt, type

dir /s d:\>filename.txt

There ARE hidden and system files that this method won't detect (you could
add the /a:h or /a:s switches if you're worried about
these - type DIR/?
at the prompt for more data) but if you're serious about "every
file" and you want to select the data delivered to a .CSV file,
then try
for /f %i in ('dir /s/b d:\') do echo
"%~fi","%~ti","%~zi">filename.csv
try
FOR /?
from the prompt for the "~" modifiers.
* ~f (full filename) was only introduced with XP, IIRC. ~dpnx will
produce the full path should ~f be unavailable.

(This will take a while to run though....)

* Change each "%" to "%%" to execute as a line of a batch file if
required
Type
EXIT
to quit CMD.EXE

More batch techniques discussion : alt.msdos.batch.nt (for
NT/2K/XP) or alt.msdos.batch (for DOS/9x)

While your answers are great - I have to disagree with one part..

Your use of "if it walks like a duck and talks like a duck.." -- That has
never held water. =)
That is a subjective statement. I can think of several examples that simply
disprove it with minor substitutions of 'duck'. *grin*
 
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
 
In
W3 tal fulano 1 said:
How can you list ALL the files on your computer in a single list that
you can sort and/or edit using Excel and that includes file size and
location, etc.?

(This was easy in the old MS DOS days, but a way to do this in Windows
eludes me. I don't know how to get My Computer or Windows Explorer to
show me the whole tree of files, and their displays can't be cut and
pasted or otherwise edited and saved. Am I missing something obvious.
. . ?)

I'm using Windows XP Pro and Office Pro.

In advance, thank you.

There's no more DOS, but you can still use the command line to generate a
file -

dir /? will help.

I also recommend looking for TreeSize Pro from JAM Software (shareware) for
a very nice utility that may do what you wish more easily.
 
The old M$ Backup program (Win 98SE) could give you a report of every file, but
you'd have to save the Wordpad report in a seperate folder after the backup was
done. Be sure your Date and Time settings include 4 digits for the year in
Control Panel. You'd have to break this up into separate 630 MB backup jobs
using the checkboxes in M$ Backup.

Trying to do this over 60 CD's would be a total PITA.

The "Find" Feature on my computer stops at 10,000 entries.
 
Your quackers!


--

Hope this helps.

Gerry
~~~~
FCA
Stourport, England

Enquire, plan and execute
~~~~~~~~~~~~~~~~~~~
 
that is a very easy question with an easy answer, just go to
START/search then on the right hand colum click the green arrow next to
DOCUMENTS. then next, chechk the don't remember then in the search
feild type *.xls and change the page layout to details to see the
location of all the files
 
but to notice he wants to edit this information in excel. sorry, you
can not edit this information in excel. but thats the only thing it
does not do.
 
W3 said:
How can you list ALL the files on your computer in a single list that you can
sort and/or edit using Excel and that includes file size and location, etc.?

(This was easy in the old MS DOS days, but a way to do this in Windows
eludes me. I don't know how to get My Computer or Windows Explorer to show me
the whole tree of files, and their displays can't be cut and pasted or
otherwise edited and saved. Am I missing something obvious. . . ?)

I'm using Windows XP Pro and Office Pro.

In advance, thank you.


From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR command
(type "dir /?") will work with this command, if you wish to modify the
output. You can then subsequently edit the resulting text file using
NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379



--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH
 
Bruce said:
From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR command
(type "dir /?") will work with this command, if you wish to modify the
output. You can then subsequently edit the resulting text file using
NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379

--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH

I think you have to use the /s switch in order to get dir to list the contents of
subdirectories. In other words, dir c:\ /s > allfiles.txt
Unfortunately, the /s switch doesn't seem to work with the /b switch (which lists
just the names, without the size & date/time of creation) so you'll have to do a
lot of non-straightforward editing to get a usable list.
 
Back
Top