Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    2

    Default copying file names

    Hi, I have an WD external hard drive,when I plug to my laptop via USB,up comes the contents of this drive.What I am trying to do is copy the file names without copying the files so that I can print a list of whats on the h/drive. Hope this makes sense !!

  2. #2
    Computer Tech
    Join Date
    Dec 2004
    Location
    Oamaru
    Posts
    5,811

    Default Re: copying file names

    You could do something like this:
    Open a command prompt - Start - Run - cmd

    Type in

    dir h: > c:\files.txt

    That will create a file called files.txt on your C: with a list of the files/folders that show on your usb drive.
    You can open and view it and then print if you want.

    If you need to see all files and folders, even those inside the folders on the root H: then use:

    dir /s h: > c:\files.txt


    This is going from memory and I haven't done that for a long time so hopefully it is correct.

  3. #3
    Junior Member ManUFan's Avatar
    Join Date
    Feb 2006
    Location
    Greymouth
    Posts
    245

    Default Re: copying file names

    Quote Originally Posted by CYaBro View Post
    You could do something like this:
    Open a command prompt - Start - Run - cmd

    Type in

    dir h: > c:\files.txt

    That will create a file called files.txt on your C: with a list of the files/folders that show on your usb drive.
    You can open and view it and then print if you want.

    If you need to see all files and folders, even those inside the folders on the root H: then use:

    dir /s h: > c:\files.txt


    This is going from memory and I haven't done that for a long time so hopefully it is correct.
    Almost...

    Open command prompt as above... When finished 'exit' + ENTER to close command window

    dir h: /s > c:\files.txt


    Full "dir" switches... (from dir /?)

    Displays a list of files and subdirectories in a directory.

    DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
    [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

    [drive:][path][filename]
    Specifies drive, directory, and/or files to list.

    /A Displays files with specified attributes.
    attributes D Directories R Read-only files
    H Hidden files A Files ready for archiving
    S System files I Not content indexed files
    L Reparse Points - Prefix meaning not
    /B Uses bare format (no heading information or summary).
    /C Display the thousand separator in file sizes. This is the
    default. Use /-C to disable display of separator.
    /D Same as wide but files are list sorted by column.
    /L Uses lowercase.
    /N New long list format where filenames are on the far right.
    /O List by files in sorted order.
    sortorder N By name (alphabetic) S By size (smallest first)
    E By extension (alphabetic) D By date/time (oldest first)
    G Group directories first - Prefix to reverse order
    /P Pauses after each screenful of information.
    /Q Display the owner of the file.
    /R Display alternate data streams of the file.
    /S Displays files in specified directory and all subdirectories.
    /T Controls which time field displayed or used for sorting
    timefield C Creation
    A Last Access
    W Last Written
    /W Uses wide list format.
    /X This displays the short names generated for non-8dot3 file
    names. The format is that of /N with the short name inserted
    before the long name. If no short name is present, blanks are
    displayed in its place.
    /4 Displays four-digit years

    Switches may be preset in the DIRCMD environment variable. Override
    preset switches by prefixing any switch with - (hyphen)--for example, /-W.

  4. #4
    amateur expert dugimodo's Avatar
    Join Date
    Dec 2005
    Posts
    8,070

    Default Re: copying file names

    Yup, or open notepad, copy and paste that command line into it, save the file as say dirlist.bat

    You could remove the h: parameter then copy the bat file to the root directory and it will work, reason being it will then work for any drive letter as long as you run it from the root dir of that drive. to the root directory
    Ryzen 2700X, 16Gb DDR4RAM, 512GB M.2 NVME SSD, MSI GTX1070

  5. #5
    Junior Member
    Join Date
    Jan 2015
    Posts
    2

    Default Re: copying file names

    Hi, tried all these things ,but no luck.Tried displaying files on external drive and do screen print which I pasted to "MS word"but then left with the whole page and not able to delete the parts I don't want.

  6. #6
    pcsourcepoint
    Join Date
    May 2006
    Location
    Otara, Auckland
    Posts
    3,063

    Default Re: copying file names

    Try explorer. Select all files (control A). Right click and hold shift key. Has option to choose copy path names (or similar). Then paste.
    Computer Tech Links (My Tutorials & Reviews)| Free MP3 Software Reviews (My Reviews)|I Student NZ (My Student Resoucre Tips)

  7. #7
    Member ruup's Avatar
    Join Date
    Dec 2004
    Location
    Palmerston North
    Posts
    797

    Default Re: copying file names

    ' The Ghost of Tom Joad '

  8. #8
    Member beama's Avatar
    Join Date
    Dec 2004
    Location
    where eye patches are worn with pride
    Posts
    1,726

    Default Re: copying file names

    try Tree H: /F >> c:\dir.txt from cmd prompt
    Trust me. I know what I'm doing.Sledge Hammer

    Linux the only way to get rid of the windows boot sector virus ( Geoff Palmer , Jun 28, 2004 Tips & Help : Tux Love, PCWorld NZ)

    Parkinsons NZ


  9. #9
    amateur expert dugimodo's Avatar
    Join Date
    Dec 2005
    Posts
    8,070

    Default Re: copying file names

    Those suggestions do work, you sure you understand what to do? To create a basic batch file try this (you can get fancier once it's working if you like)

    Open notepad
    Cut and paste this into it: dir /s > files.txt
    click file - save as - Save as type "all files" - name it dirlist.bat
    find that bat file, copy it to the drive, double click it, a txt file called files.txt appears, double click it and there's a txt list of the directory. It's a simplified version of above suggestions that'll create the file in the same place it's run from so you just leave it in the root directory of the drive.

    Otherwise try ruup's suggestion or one of the ones here http://www.makeuseof.com/tag/5-ways-...ts-in-windows/
    Ryzen 2700X, 16Gb DDR4RAM, 512GB M.2 NVME SSD, MSI GTX1070

  10. #10
    Senior Member Paul.Cov's Avatar
    Join Date
    Aug 2006
    Posts
    2,743

    Default Re: copying file names

    Yeah, I do a similar thing. My two techniques have both been mentioned. My lazy way...

    Start> Command Prompt (or just CMD)

    H: (or other drive letter)

    Dir *.* /s >>H.txt


    Alternative, if looking for only mpg files on the drive: Dir *.mpg /s >>H.txt


    But as already said, if saved as a Bat file, then all reference to the drive letter can be omitted, just copy the bat to the drive, and run it.

    I use this technique to get a Dir list of all my drives. I import the results into MS Access, then use a (tedious) routine to compare file sizes and dates to determine where duplicates exist, and their quantities ( eg to ensure 2 backups of all files, each should have a file count of 3 or more).

    There are duplicate file finders on the net with similar functionality, which do a hash check as well, but these are no quicker.

Similar Threads

  1. Old file names 8.3
    By Thomas01 in forum PressF1
    Replies: 3
    Last Post: 29-07-2005, 05:42 PM
  2. File Names
    By Bobdobalino in forum PressF1
    Replies: 1
    Last Post: 05-10-2003, 12:00 PM
  3. Can't see file names
    By in forum PressF1
    Replies: 2
    Last Post: 05-12-2001, 03:27 PM
  4. Bad doc file names?
    By in forum PressF1
    Replies: 1
    Last Post: 13-09-2001, 11:43 PM
  5. file names ?
    By in forum PressF1
    Replies: 3
    Last Post: 11-04-2001, 03:09 PM

Posting Permissions

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