No need in using any scripts. Usually, the flash disks are partitioned. But some of them are not, like my Silicon Power 16 GB was. In this case, you need to create a partition first. (but if the stick is already partitioned, no need to repartition and reformat)
First, when working with DFSee, you need to select the current disk with File->open object to work with->Partition->... No need to reformat and repartition. Just add the LVM info, eject and reinsert the disk and it will be seen under OS/2. This is indestructive, you can do this (add LVM info) without losing any files from the stick, as the only info added is the LVM DLAT sector immediately before the partition boot sector. I do this with any friends or clients flash sticks they are carrying to me to pass me their files.
So, usually, you only need to add the LVM info, and it will work fine under OS/2.Those sticks that are big floppies, can be seen with Lars' USBMSD.ADD version. It adds a virtual DLAT sector too, so no need to add it with DFSee. But partitionable media are better and more secure, so, it is recommended to repartition your flash disks. You only create the partition, and that's it.
For booting from flash disks, you may need to normalize the geometry in the partition table. Some BIOSes, like mine, doesn't like some flash disks geometries (cylinders/heads/sectors numbers), and as a result, won't boot from them. So, it is better to redefine the flash geometry to the geometry having 255 heads and 63 sectors per track. This is done with GEO command in DFSee. You can run "geo" without parameters to see the current disk geometry. It will show the cylinders, heads and sectors numbers.
The total number of sectors on the disk is equal to Cylinders * Heads * Sectors. So, you just multiply the current values to get the total number of sectors. Then divide the result to (255 * 63) and you will get the new number of cylinders.
Then wipe the disk with the
wipe "" 0 2048
command, which overwrites the disk with an empty pattern ("") starting from 0 sector, and rewrite 2048 sectors then, starting from the 0 sector.
Then enter the
geo Cyls 255 63
where Cyls is the new number of cylinders you just calculated. This should change the current geometry of the disk. Then go to Mode=FDISK->Create new partition, and create a primary partition, occupying all the disk. When operation finishes, quit DFSee, eject and reinsert the disk. Then do lvm /rediscoverprm and the new drive letter will appear. Then do
format o: /fs:fat32
and format the disk. You should install the latest version of fat32.ifs 0.10 for this command to be working.
But these steps are not mandatory. They can help the flash stick to be capable of booting from it, and to convert the stick from the big floppy to the partitionable one (which will improve the compatibility with majority of OS'es, including OS/2 installations, which haven't Lars' USBMSD.ADD installed) The mandatory thing is a command to add the LVM info. You need to define an explicit drive letter, or set the drive letter to "*:" (which means, the 1st available one). WIthout this, the drive letter won't be assigned to an USB stick/hard disk and the disk contents won't be seen.