You need to set targetLocation to your output folder and use targetNameExpression only for the filename. Also make sure your variables like ${version} are defined. For example: groovy Copy Edit fileCopyOperations( includes: 'build-*/Release/program', flattenFiles: true, renameFiles: true, sourceCaptureExpression: 'build-(.*)/Release/program$', targetLocation: "${env.WORKSPACE}/output", targetNameExpression: "\$1-program-${version}" ) Make sure version is defined in your script before this step. The FATAL: null error often happens if these are missing or misconfigured.