command line help

J

Jeff

I have a text file that contains a list of files (with their full paths).

What command line command should I use to copy the files listed (the
actual files) from their locations to a folder on my HDD?

Can I just use the list filename or do I need to copy the actual
filenames in that file in my command?

They are jpgs that I want to transfer to a SD card.

Thanks, Jeff
 
B

BillW50

I have a text file that contains a list of files (with their full paths).

What command line command should I use to copy the files listed (the
actual files) from their locations to a folder on my HDD?

Can I just use the list filename or do I need to copy the actual
filenames in that file in my command?

They are jpgs that I want to transfer to a SD card.

Thanks, Jeff
Whoa... why do things the hard way? Why not use something like SyncBack
(the free version will do the job) and do it that way?
 
S

SC Tom

I have a text file that contains a list of files (with their full paths).

What command line command should I use to copy the files listed (the
actual files) from their locations to a folder on my HDD?

Can I just use the list filename or do I need to copy the actual filenames
in that file in my command?

They are jpgs that I want to transfer to a SD card.

Thanks, Jeff
If the text file is a list of just the filenames and their paths, then you
could just paste "copy " in front of each one, and the destination path at
the end of each filename, then save the text file as a .bat.

I haven't used SyncBack that BillW50 suggested, but if you have a number of
files to copy, that may be an easier way.

I guess you could write a Basic program like "Copy A$ B$" where A$=your
filenames and B$=your destination. I haven't done anything like that in
decades, but I'm sure it would be easy enough to do if I could remember all
the stuff I did (sometimes it's hell getting old :) ).
 
A

Andy Burns

I have a text file that contains a list of files (with their full paths).

What command line command should I use to copy the files listed (the
actual files) from their locations to a folder on my HDD?
FOR /F %i IN (your.file) DO COPY %i C:\your\folder
 
W

Wolf K

I have a text file that contains a list of files (with their full paths).

What command line command should I use to copy the files listed (the
actual files) from their locations to a folder on my HDD?

Can I just use the list filename or do I need to copy the actual
filenames in that file in my command?

They are jpgs that I want to transfer to a SD card.

Thanks, Jeff
The Copy command copies the file as named, so all you would in fact copy
is the text file itself.

The easiest eway to do what you want IMO is to use Explorer to navigate
to the folders in which the jpgs are stored, and Copy them to the SD
card. You can do Select --> drag'n'drop if you have two Explorer windows
open.

HTH
 
W

Wolf K

FOR /F %i IN (your.file) DO COPY %i C:\your\folder
Thanks, Andy, didn't see this before I wrote my answer. Neat trick. I
may even remember it for next time. ;-)
 
A

Andy Burns

Wolf said:
Thanks, Andy, didn't see this before I wrote my answer. Neat trick. I
may even remember it for next time. ;-)
In case any of the file or folder names have spaces in them (not
unlikely with music files) it might be safer to use

FOR /F "tokens=*" %i IN (your.file) DO COPY "%i" "C:\your\folder"
 
S

Six Underground

FOR /F "tokens=*" %i IN (your.file) DO COPY "%i" "C:\your\folder"
Deep batch.

Great stuff. I could use a refresher tutorial. Think I'll go look
for one on the web.

Enjoy the day.

6U
 
J

Jeff

The Copy command copies the file as named, so all you would in fact copy
is the text file itself.

The easiest eway to do what you want IMO is to use Explorer to navigate
to the folders in which the jpgs are stored, and Copy them to the SD
card. You can do Select --> drag'n'drop if you have two Explorer windows
open.

HTH
The files are not in sequence. I would need to reselect them
individually which is what I am trying to avoid.
 
J

Jeff

Whoa... why do things the hard way? Why not use something like SyncBack
(the free version will do the job) and do it that way?
I will look into that. Am not familiar with it.
 
A

Andy Burns

J. P. Gilliver (John) said:
What does the /F do?
Tells it to read the contents of your.file, rather than use your.file as
a token, usually without the /F you'd put several items (nominally
filenames) inside the brackets, e.g.

FOR %i IN (red green blue) DO ECHO %i

or with /L you can do loops

FOR /L IN (10,2,20) DO echo %i

will print all even numbers from 10 to 20.

/D will do directories

type FOR /? in a command prompt window for info
 
G

G. Morgan

That is what I was looking for. It's been years since I did DOS
commands. Will try it.
Ask the guys in "alt.msdos.batch.nt" they can whip up some pretty neat
batch files that will catch any errors you may encounter.
 
G

Gene E. Bloch

FOR /F %i IN (your.file) DO COPY %i C:\your\folder
Spoiler!

Just kidding. I couldn't remember the syntax. In fact I wasn't even
ready to trust my memory that the Windows command processor could do
it[1], so I would have had to go to 'help for' to find out.

Thanks.

[1] I *know* Unix can do it, but I'd need a man page there too - been
too long :)
 
J

J. P. Gilliver (John)

Andy said:
Tells it to read the contents of your.file, rather than use your.file
as a token, usually without the /F you'd put several items (nominally
filenames) inside the brackets, e.g.

FOR %i IN (red green blue) DO ECHO %i

or with /L you can do loops

FOR /L IN (10,2,20) DO echo %i

will print all even numbers from 10 to 20.

/D will do directories
Thanks for that.
type FOR /? in a command prompt window for info
I did (in XP), but couldn't see the /F one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top