Help - Search - Members - Calendar
Full Version: batch file help
Vault9 Forums > Tech Den > Binary Refinery > Smooth Operators

Custom Search
Paul
I have a folder in my C: drive

I need to write a batch file to copy the contents of that batch file to a folder on a server

it needs to overwrite the files without prompting yes or no

how do I do this?

(stupid clients, not for me)

then from another pc

I need to write a batch file that goes and grabs the contents of that folder and dumps it on my local drive
fx
http://www.microsoft.com/resources/documen...y.mspx?mfr=true

you can pass it command line switches etc
W@RP@T}{
Paul, it's pretty simple

Just do a IF NOT EXIST C:\FolderBla
MD C:\FolderBla
Xcopy \\PC1\<folder you've shared> C:\FolderBla /r /d /y

W@RP@T}{
What's good about the /r /d /y

Is that it only overwrites the files if the files from the source are newer than the existing files and it does it without prompting.

thus if you have a file that you need to update on a whole bunch of machines you just share a directory where it will compare the file to the one on their machine to the one shared and overwrite if needed.

You can also use these in logon scripts etc. I keep about 100 templates in sync on the network via logon.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Custom Search
Invision Power Board © 2001-2008 Invision Power Services, Inc.