Victor Chew wrote:
How about creating the directory right before the syslinux command
I thought about that possibility before, but it doesn't solve the second potential problem I mentioned: a file is then copied to
during the "xcopy" procedure. This *could* be a problem.
The UBCD ISO images include this
file, and it is copied during the "copying files" phase of the script.
Although this file is not strictly necessary in the ISO image, it can be helpful in some cases, so I am not recommending removing it from the UBCD ISO images. Moreover, the ubcd2usb script can be executed from a different media such as a removable drive (not just from extracting the original content of the ISO image or from an optical media). This means that the script should still consider the possibility that
would be copied over to the USB media, even if official UBCD ISO images wouldn't include it (and, to be clear, I am still in favor of including this file in the ISO image).
Now, executing the SYSLINUX installer before copying the rest of the files also improves the chances for the ldlinux.sys file to be located in a relatively low LBA, which potentially helps when booting buggy BIOS. So this is the second reason to execute the SYSLINUX installer before copying the rest of the files.
If the SYSLINUX installer is executed *again* after the files are copied (which is one of my proposals posted above), I am unsure whether this file would still occupy a low LBA (or as low as when the first time it was installed).
OTOH, if the SYSLINUX installer is only executed once, after the files are copied, we miss (lose) the two aforementioned advantages that we currently have.
So, a more-complete solution would be to:
1_ As you suggested, add a step for the creation of the directory before executing the SYSLINUX installer; then,
2_ Add code to the "xcopy" command so to copy all files *except*
I currently don't remember if there are such xcopy arguments available without over-complicating the current script. If such xcopy argument exists (I'll have to take a look), and if adding it doesn't imply making a “mess” of the xcopy section of the script, I think this would be the best solution.
BTW, some time ago someone posted in this UBCD forum a suggested new alternative ubcd2usb.cmd script. The potential problems I am describing here are also relevant to that other script too.