How to copy a lot of files?


R

Rob

Hi All,

I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files.
I need to copy all *.doc* files from the CDs and DVDs
to one directory on my HDD.
I don't need anymore information from which CD or DVD
and from what directory or subdirectory any file was copied.
I want to have them all in one directory on my HDD.
It could happen that the same file was saved in more than one
directory. It would be useful if the same files could be copied
only one time.

I know that I'll have to put CDs and DVDs, one by one, to the
DVD drive. But I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.

I use Windows XP Pro SP3.

Please help me how to do it.

Regards,
Rob
 
Ad

Advertisements

P

Paul

Rob said:
Hi All,

I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to copy all *.doc*
files from the CDs and DVDs
to one directory on my HDD. I don't need anymore information from which
CD or DVD
and from what directory or subdirectory any file was copied.
I want to have them all in one directory on my HDD.
It could happen that the same file was saved in more than one
directory. It would be useful if the same files could be copied
only one time.

I know that I'll have to put CDs and DVDs, one by one, to the
DVD drive. But I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.

I use Windows XP Pro SP3.

Please help me how to do it.

Regards,
Rob

You need a script with a "find" file capability.

Linux allows writing that in one line. Windows should
too, but I don't know what the command would look like
in that case.

http://www.computing.net/answers/programming/batch-script-to-find-rename-and-copy-files/22674.html

Apparently Powershell has a cmdlet that does Linux-find-like things.

Get-ChildItem
http://technet.microsoft.com/en-us/library/ee176841.aspx

http://social.technet.microsoft.com...h-getchilditem-help?forum=winserverpowershell

There are also dedicated programs (.exe) for doing what
you want to do.

*******

OK, this one looks close.

http://forums.techguy.org/dos-other/996133-batch-find-copy-files.html

FOR /F "tokens=*" %%A IN ('dir /b /a-d /s *.sib') DO copy "%%A" C:\directory1\

You will be working with two file names. Create a new
text file "mycopy.txt". Edit with notepad. Copy the
line of text into it. Save the file. Exit Notepad.
Now, in Explorer, rename the file to mycopy.bat.
The script is then ready to run. When you want to
edit the script and make changes, change the file
extension back to .txt and edit with notepad. You
will need file extensions turned on in Windows, to
be able to do this (one of the first things I change
and correct on a new installations).

[ I'm sure someone knows a better way to do that,
but I just want this damn thing to run right now :) ]

With my newly minted .bat file ready to go,
run it in a Command Prompt window. Place the .bat file
into a folder which is in your path environment variable.
The path defines where executables are contained, it
defines a search order to find programs when you type
their names. I don't recommend littering a system
folder with crap like this, but that might be an
option if you're desperate :)

You will need to create the target folder, because we didn't
add that step to the script or anything. The folder
C:\directory1 has to exist for the script to work.
That's where all your files will be going. If you
expect duplicates, then that has to be handled somehow.
The copy command might stop if a duplicate happens,
or it might just overwrite. Again, my ignorance of
the specifics of the copy command, I can't tell
what happens there.

So I modify the script a little bit, like put my
optical drive E: into the dir command. Change the
extension because we want some .doc files.

mycopy.bat

FOR /F "tokens=*" %%A IN ('dir /b /a-d /s E:\*.doc') DO copy "%%A" C:\directory1\

To test a new script, you replace the "dangerous" part with
something safe. Now, being entirely ignorant of Windows
scripting, I could try this first. This would be my
first run of the script. I check what is printed in
the Command Prompt window, as proof it's looking
for the right stuff.

FOR /F "tokens=*" %%A IN ('dir /b /a-d /s E:\*.doc') DO echo "%%A"

Once I'm happy with the perceived results, I edit mycopy.bat
and replace the echo with copy, and then the .bat is
"armed and dangerous". When I did a quick test of this, it
looked good. But I "de-fang" scripts, just to be sure
I'm not too far off the mark.

FOR /F "tokens=*" %%A IN ('dir /b /a-d /s E:\*.doc') DO copy "%%A" C:\directory1\

A clever coder would check for duplicates, and add a number
to the file name, so it doesn't conflict. But that would be
a lot more work. And a standalone utility would be a
better bet for that. Like a duplicate-finder programmer
perhaps, harnessed to just copy things or something.

Have fun and be careful,
Paul
 
P

Paul in Houston TX

Rob said:
Hi All,

I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to copy all *.doc*
files from the CDs and DVDs
to one directory on my HDD. I don't need anymore information from which
CD or DVD
and from what directory or subdirectory any file was copied.
I want to have them all in one directory on my HDD.
It could happen that the same file was saved in more than one
directory. It would be useful if the same files could be copied
only one time.

I know that I'll have to put CDs and DVDs, one by one, to the
DVD drive. But I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.

I use Windows XP Pro SP3.

Please help me how to do it.

Regards,
Rob

One way:
You can use the default win xp Search.
Open Search\search options\advanced options, check subfolders
(and system and hidden if needed).
Enter *.doc in "search for files...". Enter the search path
in "Look In". Highlight one of the files found then click
Control A to highlight them all, drag to the location
or Ctrl C then Crtl V at the destination.
The search window will stay open and can be reused by
clicking "Search Now".

You can do that for specific folders as well but will have
to enter the FULL path into the "Look in" box.

Another way:
You can also use XCOPY in a CMD window.
Enter XCOPY /? in a CMD window and read the results.
It's harder than using win search but you can make
an automated *.bat file to run it. You will figure it out.
 
R

Rob

Thank you very much for your answer.
I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to
copy all *.doc* files from the CDs and DVDs
to one directory on my HDD. [...]
I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.
One way:
You can use the default win xp Search.
Open Search\search options\advanced options, check subfolders
(and system and hidden if needed).
Enter *.doc in "search for files...". Enter the search path
in "Look In". Highlight one of the files found then click
Control A to highlight them all, drag to the location
or Ctrl C then Crtl V at the destination.

That was my first idea I tried to do. Unfortunately this way
all directories and all files in them are copied, not only
*.doc files.
I don't know why and telling the truth I don't understant it
but it's a fact.
Another way:
You can also use XCOPY in a CMD window.
Enter XCOPY /? in a CMD window and read the results.
It's harder than using win search but you can make
an automated *.bat file to run it. You will figure it out.
This way only *.doc files are copied but with full path.
It is better than above but still it is not what I need.

Regards,
Rob
 
R

Rob

I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to
copy all *.doc* files from the CDs and DVDs
to one directory on my HDD. [...]
I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.

You need a script with a "find" file capability.
[...]
Have fun and be careful,

Thank you very much for your long reply.
Now I need time to study and try the methods you suggested.

Regards,
Rob
 
Ad

Advertisements

R

Rob

Perhaps the simplest solution is using Xxcopy and the switch /SGFo.
Thank you very much for your answer but Xxcopy is not a valid command
in my system, (I use Windows XP Pro SP3).
I tried the xcopy with the swithes SGFo and SG but it doesn't work. :-(

I have just downloaded and installed the xxcopy (it is freeware for personal
use) but the window opens and shuts so quickly that I amd not able to do
anything.

Regards,
Rob
 
R

Rob

Perhaps the simplest solution is using Xxcopy and the switch /SGFo.
I have just downloaded and installed the xxcopy (it is freeware for
personal
use).
I ran the Xxcopy console and it gives what I need with SG switches.
Thank you once more, very, very much.

Regards
Rob
 
K

Ken Blake, MVP

I have just downloaded and installed the xxcopy (it is freeware for personal
use) but the window opens and shuts so quickly that I amd not able to do
anything.


Do not use xxcopy from the command line. Run cmd, then use xxcopy in
it.
 
M

micky

Thank you very much for your answer.
I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to
copy all *.doc* files from the CDs and DVDs
to one directory on my HDD. [...]
I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.
One way:
You can use the default win xp Search.
Open Search\search options\advanced options, check subfolders
(and system and hidden if needed).
Enter *.doc in "search for files...". Enter the search path

Did you notice this line above. Maybe the .lack of a space before
"search" misled you. Enter asterisk dot doc in the search field.
Actually I don't think you need the asterisk, because the entire
Search program seems to assume asterisk before and after what you
type. You might have to type a space after doc to avoid geting
windows.documentary.pdf etc.

But all in all, it sounds easier to use CMD commands.
That was my first idea I tried to do. Unfortunately this way
all directories and all files in them are copied, not only
*.doc files.

See above.
I don't know why and telling the truth I don't understant it
but it's a fact.


This way only *.doc files are copied but with full path.

Not if you do it right. It's subtle, but you can make some test runs
with only a couple files. You can ask for more info in
alt.msdos.batch, and you can ask dos questions a lot of ngs that
aren't named dos. but to start you out, it depends on how you write
the commands. My recollection is not so good, but it might depend on
whether you end the directory names with a slash or not. If I'm wrong
about that, I'm still sure you can do it.


I'm figuring your not going to finish in one day, or you'll buy more
CDs etc in the future. Do some work up front and when you're done,
you'll only have to put the disc in the drive and run ExtractDoc or
whatever you call it, and it will do everything. You can also make it
write a file to the HDD saying what all it copied, etc.
-----------

If you want to make your life really easy, download XXCOPY It's
free for individual use, and runs on XP and maybe higher. The author
is still working on it. It has all the options of XCOPY, and many
many more, maybe 3 times as many. It has better help than XCOPY.
Plus it has a busy Yahoo group with users and the author himself who
will answer questions on how to do things. And the ability to
search Yahoo group archives, though I never do that.

I guarantee you that it has an option or method not to copy more than
the file itself, without any path.

Your bat file might be only 3 or 4 lines, or less.

(There is also XXClone by the same author. The simple version is
free, though one should really use something less simple. It has a
google group, iirc, though not a newsgroup.)
---------------------

You also can make your life easier by installing TCC LE, which is free
for individual use, and definitely runs on winXP (and maybe higher) .
It has all the commands and options of DOS, and many many more, maybe
3 times as many.

I have both TCC LE and XXCOPY XXCOPY runs fine in a TCC LE window.
You can set your computer up with icons to start both CMD and TCC,
althought there is little reason to run CMD once you have TCC LE

(Especially it has the List command, which allows you to look inside
any file, without loading it into an editor, and with no chance you'll
modify the file, and it runs verrrrry quickly, so that you can look in
80 or 100 files in a minute if you can decide that quickly. You're not
limited by the speed of the software. )

It probably has better help too. It might well have an option for
copy or xcopy that suppresses the path.

Here is a newsgroup for it, comp.os.msdos.4dos, which I think still
has readers and posters, when people ask questions. 4DOS was its
earlier name, and Norton DOS was another name for it, when Norton was
distributing it. 15 years ago.
 
J

jim

Rob said:
Hi All,

I have a lot of CDs and DVDs with a lot of directories
and subdirectories on each of them. The directories and
subdirectories contain various types of files. I need to copy all *.doc*
files from the CDs and DVDs
to one directory on my HDD. I don't need anymore information from which CD or DVD
and from what directory or subdirectory any file was copied.
I want to have them all in one directory on my HDD.
It could happen that the same file was saved in more than one
directory. It would be useful if the same files could be copied
only one time.

I know that I'll have to put CDs and DVDs, one by one, to the
DVD drive. But I don't know how to abstract all *.doc* files
from them and save the files in one directory on my HDD.
I'd like to do it more or less automatically.

I use Windows XP Pro SP3.

Please help me how to do it.

Regards,
Rob

Agent Ransack : will find all the files , then you send them to the
destination .
 
Ad

Advertisements

D

Don Phillipson

This way only *.doc files are copied but with full path.
It is better than above but still it is not what I need.

You can use CMD (DOS) utilities in a two stage process:

1. Write to file all the target filenames (with full filepaths)
using FIND [parameters] > OUTPUT.TXT
2. Copy as required using XCOPY, after first editing
OUTPUT.TXT to generate a BATch file with the
instructions you want.

As noted elsewhere, XXCOPY offers more opportunities
e.g. to make necessary subdirectories during the
copy process.
 
Ad

Advertisements

R

RobertMacy

Another way:
You can also use XCOPY in a CMD window.
Enter XCOPY /? in a CMD window and read the results.
It's harder than using win search but you can make
an automated *.bat file to run it. You will figure it out.

XCOPY, the built-in function works great, but has the limitation [from
memory] of NOT copying a file if it has a space inside the title. I have
not tested that, but for me no problem, since always use filenames that
are contiguous.

write a file in your WINDOWS folder called something.bat containing:

echo off
echo C to D disk
verify on
xcopy C:\AAA\$Contacts\*.* D:\AAA\$Contacts\*.* /D /E /C /H /Y
pause
echo on

The PAUSE is put in so that WinXP won't close the window until you cnn
examine what was transferred.

put in your own directories, note this will copy ANY file that is newer
than the file already there. So it automatically 'synchronizes' all of
your records and will continue if there is an error.

Also, 'verify on' doesn't do much, but makes you 'feel' better.
 

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