Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Listing full harddrive and CD contents?

Options
  • 10-08-2002 1:24am
    #1
    Closed Accounts Posts: 1,092 ✭✭✭


    Hi,
    is there any program out there that can scan a harddrive or cd and print out to a textfile the entire contents of the disk in the format



    C:\dir1\file1.doc
    C:\dir1\file2.doc
    ...
    C:\dir1\file(N).doc
    ...
    C:\dir2\file1.doc
    C:\dir2\file2.doc

    C:\dir(N)\file(N).doc

    all the way down to ...

    C:\dir(N)\file(N).doc



    Basically I need the full path of every file on my harddrive/cds to be written out and kept in a text file.

    Is there any command or program that can achieve this?

    Thanks!


Comments

  • Closed Accounts Posts: 16,339 ✭✭✭✭tman


    i have a vauge memory of the dir command having a switch that did that.
    tis lost in the hazy vaults of my memory tho


  • Registered Users Posts: 15,399 Mod ✭✭✭✭Thanx 4 The Fish


    dir /s does output the full contents but not in that format ..

    What os are you using, do you have any UNIX there, could use "find -name *" that outputs in that format.


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    obviously if he's quoting the directories as c:\... etc., it's a windows/dos environment and not UNIX.

    go to the command line... go to the root of the c drive ( " cd \ ") and type " dir /s > dir.txt " ... it will churn away for a while creating a text file called dir.txt ... then open this text file and see if it's what you need/want.... . . . . ..


  • Registered Users Posts: 55,517 ✭✭✭✭Mr E


    Best thing is a quickie batch file. Go to the root directory of your c:\ drive, and create a batch file called dirlist.bat.
    @echo off
    dir c:\ /s/b/a/o > c:\dirlist.txt
    dir d:\ /s/b/a/o >> c:\dirlist.txt
    dir e:\ /s/b/a/o >> c:\dirlist.txt
    etc.
    etc.
    /s = search subdirectories
    /b = brief (doesn't break for volume information between directories)
    /a = list all files (including hidden and system)
    /o = order files alphabetically

    The '>>' part means that each dir command appends to the previous dir command's output. One '>' will create/overwrite the file (hence being on the first dir command).

    Beware space consideration, though.... I just did my C:\ drive, and it created a 2mb file. Expect much bigger if (for instance) you are doing a large MP3 drive.

    - Dave.


  • Closed Accounts Posts: 1,092 ✭✭✭Pigman


    Thanks everyone for the suggestions!
    Bard and Fish you had the right idea but it wasn't quite what I wanted. Tmb, your batchfile did just the trick. Thanks!

    I changed the output to an Excel file and it's scary to find out you have 40,000 files on your computer! :)

    /////

    Got another one! :)

    Basically this one involves joining files with the SAME NAME eg I'll have 3 directories dir1 dir2 and dir3. Each directory has a file called (lets say) pigman.txt and I want to join all 3 together

    Ordinarily I could just put them all in a new directory and use a batchfile to join them but, as I said, they all have the same filename so that is not an option.

    BTW, I would consider renaming them and putting them all in the same directory except when I mentioned earlier that there was 3 files in reality there is closer to 300. :(

    Thanks in advance for suggestions!


  • Advertisement
  • Registered Users Posts: 55,517 ✭✭✭✭Mr E


    Hi Pigman,

    A modified version of the following batchfile will do what you want. Haven't got time to test it, but I recommend setting up a test directory structure and testing it on that first (just in case!).

    http://www.ericphelps.com/batch/samples/alldirs.bat.txt

    Its the :LOOPSTART function (and the DIR command before it) that you should be looking at.

    - Dave.


  • Registered Users Posts: 15,399 Mod ✭✭✭✭Thanx 4 The Fish


    Originally posted by Bard
    obviously if he's quoting the directories as c:\... etc., it's a windows/dos environment and not UNIX.

    go to the command line... go to the root of the c drive ( " cd \ ") and type " dir /s > dir.txt " ... it will churn away for a while creating a text file called dir.txt ... then open this text file and see if it's what you need/want.... . . . . ..

    Well spotted there, could be running on a dual boot aswell though couldn't he. Also if there was any windows based Unix emulators on his machine those could be used.


Advertisement