Results 1 to 6 of 6
  1. #1

    Join Date
    Dec 2001
    Age
    42
    Posts
    8,595
    vCash
    500
    Rep Power
    2418

    Copying a directory of file names to a Word document

    Hi everyone,

    I have been trying to copy a huge list of file names from a directory into a Word document, and I am having trouble (I am using WindowsXP 2002). I am going into the command prompt and typing DIR /B /O:N > filename.txt. When I do this, it tells me that it is unauthorized. I am trying to copy from a drive (X) and a folder named archive. Thoughts? There are THOUSANDS of files in there, and I don't want to have to copy and paste each one.

    Thanks!

  2. #2

    Join Date
    Dec 2005
    Location
    New England, USA
    Posts
    5,966
    vCash
    470
    Rep Power
    12551
    Have you tried the Print Directory feature in Windows? You can find the info at the Microsoft site.
    AceOn6, the golf loving skating fan

  3. #3
    Registered User
    Join Date
    Jan 2005
    Location
    Diagonally parked in a parallel universe.
    Posts
    4,808
    vCash
    500
    Rep Power
    0
    Are you trying to generate editable text? (i.e., a list of filenames that you can sort by name, date, etc.) Or is simply creating a "picture" of the filenames sufficient?

    If the former ... I'm not sure it's possible. I know I've tried to do that in the past and haven't found a way. But then I didn't spend that much time trying to figure it out.

    If the latter will do, it's much easier: simply do a screen print (PrtScn) of your directory display, one screen at a time, until you get them all.

    Of course if you upgraded to Win7 it's even easier -- Win7 comes with a fabulous little screenshot tool.

  4. #4

    Join Date
    Dec 2005
    Location
    New England, USA
    Posts
    5,966
    vCash
    470
    Rep Power
    12551
    Pretty sure Jayar needs the text, not an image. Again, Print Directory may be the only hope without some wizard scripting.
    AceOn6, the golf loving skating fan

  5. #5
    Registered User
    Join Date
    Jun 2004
    Location
    South of New York City
    Posts
    2,062
    vCash
    500
    Rep Power
    0
    DOS to the rescue! Old reliable is the easiest solution.

    <start>
    <all programs>
    <accessories>
    <command prompt>

    You'll get a black DOS command prompt that says C:\ (current folder) >

    1) Change Directory (command = "CD") and type the drive specification and folder name
    Example: CD C:\Users\SAMPLEUSER\Foldername
    Press ENTER

    2) Get a Directory listing (command = "DIR")and send it to a file (output director = ">") called "filename.txt" in that same directory.
    Example: DIR *.* > filename.txt
    Press ENTER

    3) To exit the Command Prompt, type "EXIT" and press enter.

    4) Once you've created the file, find it with My Computer or Windows Explorer and open it with Notepad.

    5) Copy-and-paste the text into your Word document.

    For more info on streamlining the directory listing, open the command window and type "DIR /?" or "HELP DIR" and hit ENTER.
    It will list all of the options and switches. The switches can get rid of the headers, footers, sort the list, and all sorts of other clever tricks.

    If this is a process you have to do regularly, use NOTEPAD to create a command batch file.

    Just type the commands you would have typed in the window into the Notepad document and save it with an extension of ".bat" so that it becomes executable. Then you can just locate it in its folder and double-click. The commands will be run automatically and create or overlay the output file.


    ETA: Is this the "Print Directory" process mentioned earlier? Hmmm...never used it, but it looks complicated. Is there something more simple?
    http://support.microsoft.com/kb/321379
    Last edited by FigureSpins; 04-07-2011 at 01:54 PM.

  6. #6

    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Age
    48
    Posts
    17,941
    vCash
    500
    Rep Power
    36617
    Figurespins - you almost make me want to use DOS. Almost.

    I might try this later.
    When you are up to your arse in alligators it is difficult to remember you were only meant to be draining the swamp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •