Hello,
Thank you for the provided screenshot.
I believe I may have found the culprit here.
As you can see, the script was created to only deliver one file to a specific folder. This can be seen in the following lines:
Code: Select all
IF NOT EXIST "%SystemDrive%\Users\%%G\AppData\Roaming\MyCompany\demoFile.config" md "%SystemDrive%\Users\%%G\AppData\Roaming\MyCompany"
xcopy.exe %1 "%SystemDrive%\Users\%%G\AppData\Roaming\MyCompany" /C /I /Q /R /K /Y
As you can see, only one file is created. Additionally,
only one file is expected as input. This can be seen in the following line:
As you may know, the %1 represents a parameter that is passed to our batch script. For instance, if we have the following .BAT file:
(let's say the name is
"hello.bat")
If you open a command prompt and call the .BAT file like this:
It will display the following:

- HelloBat.png (21.58 KiB) Viewed 9882 times
The "Catalin" value was taken as the first argument and the "Mihai" value was taken as a second argument.
In our case, it is the same. You are creating two files but the "xcopy" command expects only one parameter, while you are giving it two parameters:
[&test2.txt] and
[&test.txt]
With that being said, could you please modify the content of your .BAT file to await two parameters as input? To do so, please modify the following:
Code: Select all
xcopy.exe %1 "%SystemDrive%\Users\%%G\AppData\Roaming\MyCompany" /C /I /Q /R /K /Y
to:
Code: Select all
xcopy.exe %1 %2 "%SystemDrive%\Users\%%G\AppData\Roaming\MyCompany" /C /I /Q /R /K /Y
In addiiton to this, as it can be seen in my example, you do not need to have a separator for your parameters, therefore I believe you can remove the
",".
Hope this helps.
Best regards,
Catalin