#Mth# is surrounded by quotes because it resolves to 02 FEB, and Windows doesn’t allow a space in the file name path that isn’t surrounded by quotes.
And here’s the batch file:
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\05 D PND NO XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\05 D PND XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\05 D CMP “%4”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\32 D PND NO XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\32 D PND XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\32 D CMP “%4”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\09 D PND NO XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\09 D PND XFER “%3”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
XCOPY “\FILESERVER\IS\REPORTS”%1"\XH"%2"\09 D CMP “%4”.xlsx" “\SHAREPOINT\REGION\IS\DSR\XH\West”%1""%2"" /I /Y
%1 is mapped to #Yr#
%2 is mapped to #Mth#
%3 is mapped to #Date#
%4 is mapped to #Date-15#
When I run this manually from the command line, passing the real values to the batch file, it works perfectly. But when run from the “Run Program” activity - nothing happens. TDA reports that the program exited successfully, but no files are actually copied to the remote directory.
I’ve both simplified this a bit and made it slightly more complicated - again, it runs just fine when calling from the command line and passing the data that would be in the variables:
Further testing yielded a log file that shows that the XCOPY command is being issued from the batch file - however, it appears as though it’s not actually being run - I’m not sure if this is because of how TDA executes the batch file or what.
I know that the batch file is good, because if I run it by hand and pass the parameters along, it works perfectly.
For some reason variables in a Run activity are working fine in development build but are not in release/beta build. We’re investigating it. Suggested using of Find&Replace activity to substitute values in batch file might be a possible workaround.