Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: BAT file to copy file to multiple locations?

01 Jan 2013   #1
nevesswodniw

7 Ult x64 sp1
 
 
BAT file to copy file to multiple locations?

Hi, I have a file with no extension called simply, D:\file

I want to copy this to multiple locations, eg e:\file , f:\file

sometimes there will already be an older version, so I would like it to overwrite the file.


Is this possible with a bat file?


I tried a simple copy command in a bat file, but it wouldn't copy at all.



thanks.


My System SpecsSystem Spec
.

01 Jan 2013   #2
Pedroc1999

Windows 7 Ultimate x86
 
 

Have you tried 'xcopy' with the /y flag. This should copy the files and overwrite without it prompting you.... Would this suut your needs?
My System SpecsSystem Spec
01 Jan 2013   #3
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by nevesswodniw View Post
.....I tried a simple copy command in a bat file, but it wouldn't copy at all....
As long as you have access rights (permissions) to copy to the area of interest, then copy should work just fine. Like pedro said, you will want the "/y" switch on the end to handle overwriting any existing file(s).

It is probably best to workout the syntax using the command prompt window or include a pause in your batch file so that you can see any errors that might occur:
Name:  batch-error.png
Views: 18
Size:  8.4 KB

-batch1.png

or with wildcards

-batch2.png


My System SpecsSystem Spec
.


01 Jan 2013   #4
Pedroc1999

Windows 7 Ultimate x86
 
 

You may find yourself that you would like more "flags" or "switches" which will help refine and customize the xcopy command- here is whee i learned xcopy switches from

http://ss64.com/nt/xcopy.html
My System SpecsSystem Spec
05 Jan 2013   #5
nevesswodniw

7 Ult x64 sp1
 
 

Thanks guys, You helped me with the pause command

It said cannot find file, so had to use xcopy /h because it is hidden, wouldnt have figured it out without pause.


Thanks again!
My System SpecsSystem Spec
05 Jan 2013   #6
UsernameIssues

W7 Pro SP1 64bit
 
 

thx for posting back.
glad it is working for you now.
My System SpecsSystem Spec
Reply

 BAT file to copy file to multiple locations?




Thread Tools





Similar help and support threads
Thread Forum
Need a file copy recommendation with partial file resume
I'm currently using Richcopy to move about 4TB worth of data from our colo facility (1000 miles away) to our office. And that data also gets routed overseas first before coming back (don't ask). Needless to say, connectivity while not bad, could be better. The small files are zooming right...
Software
Copy file address after doing a file search in windows explorer
Hi All I have a rather large file system with lots of folders & subfolders. When I want to save previously on Xp operating system I'd search in explorer open the folder I want then copy the address (e.g c:\customer records\client name\job address). In windows 7, when I copy the folder address i...
General Discussion
how do I copy a BIG single file (using richcopy?) big file copy
I'm trying to copy a VHD (22g, dynamic I think...) I tried richcopy. It says copy started, but then stops.... I saw someone mention xcopy /j, to achieve the unbuffered I/O perf. you get with richcopy... it's running, but no indication as to how long it takes (EDIT: just finished, > 10...
General Discussion
How to copy a file from 1 pc to another pc in network using batch file
Help me make a batch file that copies a file from one computer to another computer in a network... PC1 = Source PC2 = Destination I want to copy a file from PC1's Drive E: to PC2's Drive E:
General Discussion
Update (copy) file to multiple places in directory structure
I have a directory structure root 1 sida 0002-A.xlp 2 sida 0002-A.xlp ...
General Discussion
File locations and zip.
Hi Guys and Gals ! I'll toss out some red meat for the Guru's. Over the years I have owned many computers dating back to the beginning of IBM's introduction of the desk top. I evolved with all of the progress however my 13 year old grandson is probably more computer literate than I am !...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 20:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App