Tech Support Guy banner
Status
Not open for further replies.
1 - 6 of 6 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Hi, I need help to make a script to copy all my canon .cr2 file (from DCMI\000CANON, 001CAnon, XXXCANON) to another drive and all .cr2 files in the same folder.

Thank you
 

·
Retired Moderator
Joined
·
106,726 Posts
I can't tell what the full directory specification is from that post, but the basic form of the copy command is.

COPY <destination>

For example:

COPY "d:\Source Folder Name\Sub Folder Name\*.cr2" "d:\Dest Folder Name\Sub Folder Name\"

Note the quotes surrounding the names, these are mandatory for long file names or names with spaces.
 

·
Retired Trusted Advisor
Joined
·
9,126 Posts
I found a batch file here: http://www.lensamalaysia.com/forum/archive/index.php/t-1702.html that (modified as shown below) will copy all of your canon *.cr2 files from all subfolders in your \DCMI folder into one folder.

Make a batch file named COPYCR2.BAT containing these lines:

@echo off
if "%1" == "" goto err1
if "%2" == "" goto err2
for /R %1 %%f in (*.cr2) do copy "%%f" "%2"
goto ending
:err1
echo Please enter the source directory
goto ending
:err2
echo Please enter the destination directory
:ending

Put the batch file in C:\Windows\system32. To copy all of your *.cr2 files into a new folder named allcr2s, type this at a command prompt:

copycr2 c:\DCMI c:\allcr2s

Edit: You do need to create the destination folder first!
 

·
Retired Moderator
Joined
·
106,726 Posts
Just toss in a MD <destination folder> in the front of the batch. ;)
 
1 - 6 of 6 Posts
Status
Not open for further replies.
Top