I’m trying to create an ISO image containing several directories and files. The directory structure I’m trying to create in the ISO image is NOT the same as what is currently on my hard drive. This process will be done by another script, so it must be done with the command line.
Example hard drive format:
a.txt
b.txt
What I want the ISO image to look like:
aFolder-|
|-a.txt
bFolder-|
|-b.txt
According to the help page for the UltraISO command line arguments, I can pass -newdir dirname
to create a new directory in the ISO image. I should also be able to use -chdir dirname
to change directories, but it’s unclear how this works and I can’t seem to get it working right.
At the moment, I am just trying to make aFolder
and put a.txt
inside it. These are the commands I’ve tried with no luck.
ultraiso -imax -l -newdir aFolder -chdir aFolder -f a.txt -output test1.iso
This creates
aFolder
but placesa.txt
at the top-level (next toaFolder
but not inside it).ultraiso -imax -l -newdir aFolder -output test2.iso
followed byultraiso -in test2.iso -chdir aFolder -f a.txt
I thought that maybe the folder had to be created with one call, and then changed into the next, but this gives the same result as 1:
a.txt
is next toaFolder
.ultraiso -imax -l -newdir aFolder -output test3.iso
followed byultraiso -in test3.iso -chdir aFolder
and thenultraiso -in test3.iso -f a.txt
Then I thought maybe there’s something internal to the ISO that stores the current directory, and that a command has to set it before you can put files inside… Nope, same as 1 and 2.
ultraiso -imax -l -newdir aFolder -f a.txt aFolder -output test4.iso
Maybe I could do
-f filename_on_disk filename_in_iso
? Nope, this command doesn’t even work:wrong parameter: aFolder
.
So how can I make a directory in my ISO image and then place a file inside that directory? I would prefer to continue using UltraISO but I am open to other suggestions.