batch file problem

Forum Windows XP : Configuration & Customize - batch file problem

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.customize (More info?)

 

I have been having a problem with a simple batch file. I want to copy from
my card reader (F:) to the hard disk (C:\pictures).
The problem is that, as I take more pictures during the day, the folder
on the F: drive (compact flash memory card in the card reader) keeps
changing, i.e., from F:\canon220\ to F:\canon\221\ etc.

A batch file like this work initially: copy f:\canon220\*.*
c:\pictures

Naturally that batch file won't work when the source directory is \canon221.
So I tried copy f:\canon???\*.* or copy f:\canon*\*.* or copy f:\*\*.*
but none of them worked.

I would appreciate any ideas for a batch file that I would not have to
change each time the camera creates a new folder for pictures on the memory
card.

Thanks, CMA

Sponsored Links
Register or log in to remove.

Archived from groups: microsoft.public.windowsxp.customize (More info?)

 

If there's only one such directory, you can

cd /d f:\canon*
copy *.* c:\pictures

If there are several such directories there's no guarantee which one
will be processed by the above example, and there is, of course, the
question of which one you want to process (the newest?). If you wanted
to process them all (including the case where there's only one), you
could:

for /d %%d in (f:\canon*) do copy %%d\*.* c:\pictures

- Vince

On Mon, 8 Nov 2004 10:31:47 -0500, "CMAR" <vrv7j@yahoo.com> wrote:

>I have been having a problem with a simple batch file. I want to copy from
>my card reader (F:) to the hard disk (C:\pictures).
> The problem is that, as I take more pictures during the day, the folder
>on the F: drive (compact flash memory card in the card reader) keeps
>changing, i.e., from F:\canon220\ to F:\canon\221\ etc.
>
>A batch file like this work initially: copy f:\canon220\*.*
>c:\pictures
>
>Naturally that batch file won't work when the source directory is \canon221.
>So I tried copy f:\canon???\*.* or copy f:\canon*\*.* or copy f:\*\*.*
>but none of them worked.
>
>I would appreciate any ideas for a batch file that I would not have to
>change each time the camera creates a new folder for pictures on the memory
>card.
>
> Thanks, CMA
>
>

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Configuration & Customize > batch file problem
Go to:

There are 1302 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them