Copy files using batch file command?
-
Im looking to make a batch file that will copy files from a jump drive and place them in a folder on the computer. What command and syntax would I use? thanks
-
Answer:
If all your files are one directory then just use the copy command. If you have multiple directories then you need to use xcopy or if you have Windows Vista or later then Robocopy is better. Xcopy and Robocopy has loads of choices depending on exactly what you want. To copy everything then you would use xcopy jumpdrive_letter:\ harddrive_letter:\directory\ /e robocopy jumpdrive_letter: harddrive_letter:\directory /e http://www.computerhope.com/copyhlp.htm http://www.computerhope.com/xcopyhlp.htm http://www.computerhope.com/robocopy.htm If you've got it then I would use robocopy. By default it only copies files if there is not an exact copy already in the destination drive which makes it great for backups.
Josh Bunzel at Yahoo! Answers Visit the source
Other answers
Create a file xyz.bat which contains the following line: xcopy source destination /E You replace source with your drive symbol such as E: etc and destination drive or directory Then, type xyz at the command prompt while you are in the DOS mode. If XCOPY is available, why do you go for batch program?
James Bond
echo off SetLocal EnableDelayedExpansion for /f "tokens=1 skip=1" %%a in ('wmic bootconfig get lastdrive') do if "!Thumbdrive!"=="" set ThumbDrive=%%a xcopy /s !ThumbDrive!\*.* %SystemDrive%\Users\%username%\desktop This will copy all items in thumbdrive to your desktop.
Jake
put the batch file on the thumb drive copy *.* c:\backup just substitute your own location
Mike
Related Q & A:
- How to extract files from pgp file?Best solution by Super User
- how to zip similar files using python?Best solution by Stack Overflow
- How to skip the input in batch file?Best solution by Stack Overflow
- How to run an interactive batch file on windows from a service?Best solution by Stack Overflow
- How to copy files n folders from both internal n external hard disks to DVD+R discs storage?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.