PDA

View Full Version : copying file names



aceterry
22-01-2015, 12:42 PM
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 !!

CYaBro
22-01-2015, 12:57 PM
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. :D

ManUFan
22-01-2015, 01:10 PM
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. :D

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 [filename] [/A[[:]attributes]] [/B] [/C] [/L] [/N]
[/O[[:]sortorder]] [/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.

dugimodo
22-01-2015, 03:48 PM
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

aceterry
30-01-2015, 12:35 PM
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.

kahawai chaser
30-01-2015, 02:05 PM
Try explorer. Select all files (control A). Right click and hold shift key. Has option to choose copy path names (or similar). Then paste.

ruup
30-01-2015, 02:16 PM
Or maybe this may help.

http://www.karenware.com/powertools/ptdirprn.asp

beama
30-01-2015, 02:43 PM
try Tree H: /F >> c:\dir.txt from cmd prompt

dugimodo
30-01-2015, 05:20 PM
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-to-print-folder-and-directory-contents-in-windows/

Paul.Cov
30-01-2015, 06:56 PM
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.

decibel
01-02-2015, 07:57 PM
Try this -http://www.infonautics.ch/directorylistprint/

(there is a free version)