Hello @DMD,
I also use a similar script and everything runs smoothly. Maybe you have install.ESD in your sources folder and not install.WIM.
If so, the script will not find the wim file and nothing will be processed.
This is just a hypothesis, it would be up to you to check it.
In my script I use:
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.* set CDROM=%%i:
Good luck!