The first dsfo command creates a dd-like image of the UFD - better be safe than sorry (and it works, OK).@Wonko
Tried to do as described (but don't know what it has to do with this topic) & mybackup.img is 2GB but the heapsofzeroes.img is only 16Kb.No errors.
Got this error: failed to create sparsefile
the cmd file attached
The small batch should take the size of the image in bytes and use mksparse to create a sparse file of the same size (a newly created sparse file will be filled with all zeroes).
Sparse files "exist" (or can exist) only on NTFS volumes, maybe your C:\ drive is not NTFS?
Or maybe an issue with the OS you are running?
If you have enough space on the C:\ drive you can create a new file with the actual size of the UFD backup by using the command fsz (also part of the DSFOK package), only be VERY careful, as if you do not have enough space or you specify aq "too big" size, fsz will attempt to create the file nonetheless, possibly filling the volume up to the brim .
The third part, the dsfi command writes back the whole 00 filled image to the UFD (thus "wiping" it).
Wonko
P.S.: There is a small typo in the batch, my bad I corrected it in my previous post, there is a colon in:
if %1.==. goto :eofbut this only affects the "trap" to avoid executing the batch without parameters.