Sign in to follow this  
Followers 0
crackedatom

Entire drive printout

19 posts in this topic

How could I get a printout of all the files and folders of a harddrive?

I've just backed up all my music to DVD and I'd like some form of list so I know what I have.

I'm going to have a look around for a perl script that could output to a text file or something...that sould do the job...

But, in the meantime...does anyone know of anything?

0

Share this post


Link to post
Share on other sites

Why not pipe the dir command to a textfile?

0

Share this post


Link to post
Share on other sites
Why not pipe the dir command to a textfile?

I didn't see an option to do that...is there?

I also want to list all the subdirectory contents too...and that some 500 subfolders

0

Share this post


Link to post
Share on other sites

ls -R > file.txt

If you are in windows try the command "help dir" and see if there is a way to enable recursion

0

Share this post


Link to post
Share on other sites
ls -R > file.txt

If you are in windows try the command "help dir" and see if there is a way to enable recursion

I wish I was using linux

and I can't do it simply using dir

0

Share this post


Link to post
Share on other sites

dir /S D:\ >dir.txt That's an old trick, just give it the path of your cdrom and away it goes.

0

Share this post


Link to post
Share on other sites

dir /?

shows that /S will show all files ina specified directory and all subdirectories.

the >

will send all the results to something else, so instead of displaing them all ont he screen, they will be sent to a text file.

so ohm would be correct, damn you for being just a bit faster =o)

0

Share this post


Link to post
Share on other sites
dir /S D:\ >dir.txt That's an old trick, just give it the path of your cdrom and away it goes.

Thanks, that's exactly what I was looking for :)

I don't know how the hell I missed /S <_<

I was getting there with the perl though :P

opendir(DIRHANDLE, "h:/mp3") || die "Cannot opendir /some/path: $!";
foreach $name (sort readdir(DIRHANDLE)) {
print "$name\n";
}
closedir(DIRHANDLE);

but that just does the same as dir

Thanks again.

0

Share this post


Link to post
Share on other sites

There are recursive find modules for Perl available on CPAN. One might even come with Perl. In Ruby though, it's pretty easy to generate a list like this.

require 'find'

Find.find('/some/path') do|f|
puts "%s - %s" % [f, File.stat(f).size]
end

0

Share this post


Link to post
Share on other sites

thres also a few programs. my dad uses one, ill ask him in 6 hours when im back from work and post it for you.

i just cant rem the name, but you can put pictures, etc, and thres databases on the net you access and you can download the pictures from there, say, album covers, movie poster, whatever, to identify it.

Also, you can make excel documents.

ill ask when hes around tonight, off to work now.

0

Share this post


Link to post
Share on other sites

tree /F \some\path would work. Just plain tree only shows directories.

0

Share this post


Link to post
Share on other sites
dir /?

shows that /S will show all files ina specified directory and all subdirectories.

the >

will send all the results to something else, so instead of displaing them all ont he screen, they will be sent to a text file.

so ohm would be correct, damn you for being just a bit faster =o)

Thanks all the same droops...even though you're a bit slow :P

pipe the command "tree" into a text file
tree /F \some\path would work. Just plain tree only shows directories.

I do like the tree command, but I prefer the dir /S D:\ >dir.txt ...it just looks a little nicer.

[edit] I made an over complicated batch file...because batch is so in right now :P

echo off
cls
color 0a
:start
echo Select an output filename...
set /P file=
if exist %file%.txt (
echo %file%.txt is already in use
) ELSE (
goto scan
)
:choice
if exist %file%.txt (
set choice=
set /p choice=Would you like to use a different name? ^(y/n^):
if not '%choice%'=='' set choice=%choice:~0,3%
if '%choice%'=='y' goto start
if '%choice%'=='n' goto overwrite
echo "%choice%" is not valid please try again.
goto choice
echo.
) ELSE (
goto scan
)
:overwrite
if exist %file%.txt (
del %file%.txt
goto start
) ELSE (
echo.
)
:scan
echo Select a directory to scan...
set /P scan=
dir /S /O:n %scan%> %file%.txt
:end
echo DONE!!
pause > nul

A little problem occurs in the :choice bit...but it sorts itself out

nb:Only works in windows 2000 + I think

Edited by crackedatom
0

Share this post


Link to post
Share on other sites

Kind of OT, but I was just reminded of someone who would keep a database of all the things he had on CD. The problem was, his database consisted of a large, unorganized collection of screenshots of explorer. You couldn't even match screenshots up to his unlabeled CDs. It took him hours to find anything, and it was pretty hilarious.

0

Share this post


Link to post
Share on other sites

If it's for windows, I'm all about the tree command as well (yay hbp!):

tree
tree > file.txt

0

Share this post


Link to post
Share on other sites
Kind of OT, but I was just reminded of someone who would keep a database of all the things he had on CD. The problem was, his database consisted of a large, unorganized collection of screenshots of explorer. You couldn't even match screenshots up to his unlabeled CDs. It took him hours to find anything, and it was pretty hilarious.

:lol: hahaha...that's what I used to do...but it took to long to crop and paste everything, so I stopped

0

Share this post


Link to post
Share on other sites
If it's for windows, I'm all about the tree command as well (yay hbp!):

tree
tree > file.txt

tree ftw

Ohm is right though, do

tree /f C:\ > tree.txt

Edited by hbp71605
0

Share this post


Link to post
Share on other sites

Ok, I changed the batch to do tree...

echo off
cls
color 0a
:start
echo Select an output filename...
set /P file=
if exist %file%.txt (
echo Error! %file%.txt is already in use.
goto start
) ELSE (
goto scan
)
:scan
echo Select a directory to scan...
set /P scan=
tree /F /A %scan% > %file%.txt
:end
echo DONE!!
pause > nul

I took out the stupid thing causing the error

Thanks again...makes my like a little easier :P

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0