|
Answer» I am trying to get a batch file that will copy the contents of a CD and move them to a share on a server and ignore the overwrite prompt. I am not familiar with writing batch files so if anyone has a template that i could just input the LOCATIONS that the copy and move will move to.
Any help will be great.If anyone has any ideas or sample script please let me know.
Help is appreciated
I assume that you are using the Copy command. The help gives this Copy /? Copies one or more files to another location.
COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. /D Allow the destination file to be created decrypted destination Specifies the DIRECTORY and/or filename for the new file(s). /V Verifies that new files are written correctly. /N Uses short filename, if available, when copying a file with a non-8dot3 name. /Y Suppresses prompting to CONFIRM you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode.
The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script.
To append files, SPECIFY a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
So you would need to add the /Y parameter to ignore the overwriting of the previously existing files
Graham
|