Sign in with
Sign up | Sign in
Your question

Need help with Batch file

Last response: in Apps General Discussion
Share
April 5, 2012 4:54:55 PM

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

More about : batch file

April 5, 2012 7:52:23 PM

campch5 said:
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

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.
!