Temporarily change %APPDATA% for portable settings (Windows: e.g. Minecraft)
set APPDATA=%CD%\data
bin\minecraft.exe
Need to take %APPDATA% directory data to another PC? For example Minecraft game saves to take in to a school for projects, or to a friend's house. The tricky part is: %APPDATA% has a different location depending on the version of Windows. Yay Microsoft, thanks once again.
The good news is that many Windows programs do use the environment variable to locate this folder, so you can just override it and launch your game or whatever from a .cmd / .bat file.
In the case of Minecraft on a USB:
E: is the USB):
E:\MinecraftE:\Minecraft\binE:\Minecraft\data\bin folder and your %APPDATA%\.minecraft into \dataE:\Minecraft\minecraft.batThis will run the game from the USB, which could be slow. Also it'll still require Java to be installed.