The issue is that it is calling the original beamthemup2.bat file, not the one copied.
@ECHO OFF
for /d %%X in (*) do (
copy "beamthemup2.bat" "%%X"
@echo "%%X\beamthemup2.bat"
pause
call "%%X\beamthemup2.bat"
)
UPDATE
This is the second bat file. It seems it is copying the and running the correct batch file. Here is the problem though. When running the above batch file first %cd% is returning the path of the first batch file, however if I run the second one by itself in the folder that I wanted it copied to, %cd% returns the correct folder.
@ECHO OFF
for /r %%X in (*) do (
"c:\Program Files\7-Zip\7z.exe" a -tzip "%cd%" "%%X"
@ECHO %cd%
pause
)
Your current working directory is still the directory you started the first batch file from. Running the second batch file doesn’t change the working directory.
Try adding
cd %~dp0to your second batch file (after@ECHO OFF). That will cd to the directory the batch file is in.