Batch Files

Posted on 2007-10-12
Medium Priority
Last Modified: 2010-04-16
How to create a batch file to move files from one location to another?
Question by:wilsonhinds

Accepted Solution

rseabird earned 2000 total points
ID: 20064880
Create an empty (text) file, rename is to filename.bat
Right-click on file en choose 'edit'

paste a string like this to copy a file:

copy C:\test.txt  D:\test.txt

Is this what you need?

Expert Comment

ID: 20064941
You may need to go to My Computer >  Tools > Folder Options > View
Uncheck "Hide extensions for known file types"

Now you can rename the text file.

If you want to use it to do a backup the xcopy command is fairly useful

type in something like

Now create a blank text file (right click > new > New Empty Text File)

Rename it to copy.bat

then type the follwing in the file - replacing the path ie c:\ with where you want to copy from & to
xcopy "c:\test" "d:\test" /d /s /c /y

This will copy all the files in a directory to a new one, it will also copy all the files that have changed since the last time you ran the command (incremental backup) it will keep copying if errors occur - files that are in use and it will overwrite the destination without prompting

This method just makes things easy


Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question