How to copy and paste with a batch file

Written by kevin lee
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to copy and paste with a batch file
You don't need a mouse to copy and paste. (mouse image by Edvin selimovic from

Windows copies and pastes objects as well as text and graphics. Using your mouse, you can select a group of files in one folder and paste them into another. The Xcopy command also copies files from one location to another. If you want to automate your copy-and-paste operations and speed up your workflow, embed the Xcopy command in a batch file. You can then execute that file manually or let Windows run it during start-up.

Skill level:

Other People Are Reading


  1. 1

    Open Notepad and type the following text:

    @echo off

    xcopy CopyFrom CopyTo

    Replace "CopyFrom" with the name of the file or folder that you want to copy . Replace "CopyTo" with the name of the destination folder. For example, to copy C:\MyFiles\xyz.txt to C:\Temp, type "Xcopy C:\MyFiles\xyz.txt C:\Temp."

  2. 2

    Click "File" and select "Save." The "File Save" dialogue window will open. Navigate to your Desktop folder and double-click it to select it.

  3. 3

    Type "xyz.bat" in the "File Name" box. Replace "xyz" with any descriptive name.

  4. 4

    Click "Save." Notepad will save the batch file to your desktop. Double-click the file and Windows will perform the copy-and-paste operation.

Tips and warnings

  • Copy and paste multiple files by adding additional Xcopy commands to the batch file. To execute the batch file when Windows starts, place it in your Start folder.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.