1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Copy Dos Batch File

Discussion in 'DOS/Other' started by dcouture, Jan 20, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. dcouture

    dcouture Thread Starter

    Joined:
    Jan 20, 2007
    Messages:
    2
    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
     
  2. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    I can't tell what the full directory specification is from that post, but the basic form of the copy command is.

    COPY <source> <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.
     
  3. Frank4d

    Frank4d Retired Trusted Advisor

    Joined:
    Sep 10, 2006
    Messages:
    9,126
    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!
     
  4. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    Just toss in a MD <destination folder> in the front of the batch. ;)
     
  5. dcouture

    dcouture Thread Starter

    Joined:
    Jan 20, 2007
    Messages:
    2
    Thank you it work :)
     
  6. gurutech

    gurutech

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    XCOPY is easier, and comes with Windows.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Copy Batch File
  1. niedernsill
    Replies:
    3
    Views:
    251
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/536828

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice