With reference to the following code snippet
xcopy D:\CBS_Upgrade\CBS2.2_DEV_B%CBSBuild%\DDLs-Lending Database\CBS-Upgrade\DDLs-Lending /S
I wanted to find out why the script is terminating and is not executing commands after that?
Is there any way to fix it?
I know the file will not be there, but I wanted the script to go on to the next commands.
The message shown by xcopy is
File not found - DDLs-Lending
0 File(s) Copied.
The simple solution is to use the
/cswitch, which instructs thexcopycommand to ignore any errors. The full documentation for thexcopycommand is available here on MSDN.But Joey is right, batch files will continue executing, regardless of whether an individual command contained therein fails. So I’m not entirely sure what the problem you’re trying to solve is.