Batch file not working properly after extraction

I have created a batch file to copy a file from the directory that a file was extracted to as part of the exe and to a subfolder in the Windows/System32. When I run this Batch file by itself, I don’t have any issue with it copying the file. But when I have it run as part of the exe package after the extraction, it runs and all the echos appear fine, but it doesn’t copy the file.

This is the code within the batch file that I am using. I am not haveing any permission issues as the I have addtional code in the batch file that gets the permissions and works fine.

COPY %userprofile%\Documents\TestBackground\BackgroundDefault.jpg %windir%\system32\oobe\info\backgrounds\BackgroundDefault.jpg

What am I missing?

How did you configure your exe package to run the batch file?

I configured the batch file to be extracted into the same directory as the rest of the files in the package and then under “General” settings, under the Launch Programs or files, I selected the batch file to launch from that same location after the package closes.

Try the custom action dedicated to running BAT files.