The default %APPDATA% is C:\Users\%USERNAME%\AppData\Roaming
If your launched program saves files in %APPDATA%, then if you use setenv=APPDATA|c:\something it will trick the launched program to save its data in c:\something instead.
It will thus practically turn the launched program into a portable one.
Usually it's that simple. But for %APPDATA% and %USERPROFILE% specifically it's more complex because:
- While it might seem the launched program uses %APPDATA%, some programs actually use %USERPROFILE%\AppData\Roaming, i.e. they are hardcoded to use AppData\Roaming even if %APPDATA% points somewhere else.
- Some programs that use %USERPROFILE% expect it to be an absolute folder. In those cases you can use setenv=USERPROFILE|..\Something whereas the ..\ part tricks the launched program to think it's an absolute path.
For example, if your desired folder is c:\parent\child then you could write ..\child.