Need help with Batch file

campch5

Honorable
Apr 5, 2012
1
0
10,510
0
Hello all, I am not good with scripting at all, so please please help me out...

I am trying to create a script to copy and overwrite files from one folder to another folder, an example would be I want all the files copied from C:\Documents and Settings\lxktvq\Desktop\News into the C:\RDC Labels\old I would like any duplicates to be overwritten without prompting me.

This is for I have a couple hundred standalone computers, and I have a folder full of updates that is on my desktop that needs to be distributed from one folder to about 15 different folders, on 3 different drives.

So if possible I would just like a sample code just to get me started on copying/overwriting duplicate files, creating folders, and deleting folders.

Please your assistance is really appreciated.

Thanks,
Chad
 

ksiemb

Distinguished
Nov 15, 2009
155
0
18,660
8

The DOS copy command has a parameter /y suppresses prompting to overwrite files. /-y causes prompting for overwriting files.
The switch /y maybe preset in the copycmd environment variable. The default is to prompt for overwrites unless a COPY command is being executed from within a batch script file.

When in dos type Help for command list. type command name /? to see format of the command.
 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
G Apps General Discussion 0
T Apps General Discussion 5
SHADOWSTRIKE1 Apps General Discussion 3
S Apps General Discussion 3
R Apps General Discussion 3
P Apps General Discussion 2
M Apps General Discussion 3

ASK THE COMMUNITY