Just to be sure, let me ask this question:
Assuming that one works in adult education and hands out USB sticks to the course participants containing (only) a predefined set of original Portable Apps (unmodified/unrun) plus some course materials in the "Documents" folder.
After the course is finished, the sticks have to be "reset" to a clean state for the next course (sticks are lent to participants for the course duration).
Would it be enough to …
- clean out the "Documents" folder (keeping empty "Music", "Pictures" and "Videos" subdirectories),
- erase all folders in the drive's root (which might have been created by mistake) except "Documents" and "PortableApps",
- copy a fresh set of course materials into "Documents",
- and simply erase all "PortableApps\<whatever>\Data" folders?
My other idea would be doing something like
rsync -av --delete <server> <stick>
which should also handle it with a minimum of writes (but takes longer since the files on the stick have to be read in order to find differences).
Reasons for this approach:
- sticks should last for a while, so no unneeded writes,
- erasing and copying everything back takes enormous amounts of time.