How to copy files to 1 folder?

R

rod

Throughout my E drive I have 4,754 files
I wish to place in 1 folder.
They are spread over 10 years and each has a filename
that will be the same for a day of the month.

The only difference is their date modified

eg
1204.gbh 11/4/2003 9:30pm
1204.gbh 9/4/2002 8:45pm
etc

How may I copy these files to 1 dedicated folder?
is it possible without the copy command advising
do I wish to overwrite.
 
P

Pegasus \(MVP\)

rod said:
Throughout my E drive I have 4,754 files
I wish to place in 1 folder.
They are spread over 10 years and each has a filename
that will be the same for a day of the month.

The only difference is their date modified

eg
1204.gbh 11/4/2003 9:30pm
1204.gbh 9/4/2002 8:45pm
etc

How may I copy these files to 1 dedicated folder?
is it possible without the copy command advising
do I wish to overwrite.

I assume that your 4754 files are spread over different
folders. If so then you could use the following batch file:
#1 @echo off
#2 set Source=E:\My Files
#3 set Target=D:\My Folder
#4 if not exist "%Target%" md "%Target%"
#5
#6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt
#7 for /F "delims=" %%a in ('type c:\Files.txt') do echo copy /y "%%a"
"%Target%
#8 del c:\Files.txt

You must, of course, remove the line numbers before running the
batch file. You must also make sure that the target folder is not
located under the source folder, in order to avoid a circular copy
process. You need to remove the word "echo" in Line #7 in order
to activate the batch file. Note also that "DOS" is an operating system
introduced some 30 years ago. It is rarely used these days. What
you probably meant in your question is the "Command Prompt"
under Windows XP. DOS would not understand the above batch file.
 
R

rod

Methinks you credit me with more understanding
than which I really posess.
I look forward to giving it a spin

Thanks very much for your time and effort
very much appreciated.
Rodney


"Pegasus (MVP)"
 
R

rod

"Pegasus (MVP)"

Are you able to assist with another?

I have several thousand random file names
as before but I have redated them eg

200302121202.gbh etc

I need to remove the first 8 digits to return to the status quo

Can a batch file do this in a file of say 30?

Rod
 
P

Pegasus \(MVP\)

rod said:
Are you able to assist with another?

I have several thousand random file names
as before but I have redated them eg

200302121202.gbh etc

I need to remove the first 8 digits to return to the status quo

Can a batch file do this in a file of say 30?

Rod

I am unable to reconcile these two statements:
"I have several thousand random file names" and
"Can a batch file do this in a file of say 30?"

If, as you previously wrote, you are inexperienced
with batch files then I would like to you to pick up
some experience with the first batch file I wrote
for you, before I write yet another one.
 
P

PD43

rod said:
Are you able to assist with another?

I have several thousand random file names
as before but I have redated them eg

200302121202.gbh etc

I need to remove the first 8 digits to return to the status quo

google Bulk Rename Utility
 
R

rod

"Pegasus (MVP)"
I am unable to reconcile these two statements:
"I have several thousand random file names" and
"Can a batch file do this in a file of say 30?"

If, as you previously wrote, you are inexperienced
with batch files then I would like to you to pick up
some experience with the first batch file I wrote
for you, before I write yet another one.

OK, first I am assembling all the files going back ten years,
I have the files on an ext drive, CDRoms, floppies.

At one stage I was renaming the files with 19980203 date style
prefix as I was worried the "modified date " would alter
the other files lie in monthly folders hence my (30) request.

Once assemled on one drive, I'll carry out your batch.
 
R

rod

"PD43"
google Bulk Rename Utility

Thank you very much.
I have always used ACDSee for renaming,
however this time I need to remove data from the file name
which ACDSee will not do.
 
R

rod

My first attempt failed :(
I set source E:\
took out line numbers
set target C:\My Folder (and created the folder)
took out echo in line 7
saved to a notepad named it test1.cmd

activated test1.cmd nothing happened



"Pegasus (MVP)"
 
R

rod

"Pegasus (MVP)"
#6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt

With adjustment, can this work with a file name
other than using an extension?

Say I wanted any files with WUPH in the file name,
how would I set the wildcards?
 
P

Pegasus \(MVP\)

rod said:
"Pegasus (MVP)"

OK, first I am assembling all the files going back ten years,
I have the files on an ext drive, CDRoms, floppies.

At one stage I was renaming the files with 19980203 date style
prefix as I was worried the "modified date " would alter
the other files lie in monthly folders hence my (30) request.

Once assemled on one drive, I'll carry out your batch.

I assume you have resolved your problems with the Bulk
Rename utility.
 
R

rod

"Pegasus (MVP)"
I assume you have resolved your problems with the Bulk
Rename utility.

No, that was just on my CDRom files,
I would still like to use your batch file on the E drive
if you care to persist.
R
 
P

Pegasus \(MVP\)

rod said:
"Pegasus (MVP)"

No, that was just on my CDRom files,
I would still like to use your batch file on the E drive
if you care to persist.
R

There are now so many posts in this thread that I am
hopelessly confused about your latest requirements.
I suggest you restate them.
 

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