MATLAB: How to download straight to USB

downloadMATLAB

matlab installer insists on downloading first to appdata\local\Temp, which it does not fit in; despite setting destination on another drive.
Is there a way to either skip the temporary appdata residency, move files during download or set up an alternate 'Temp' location?

Best Answer

Ok, so I figured it out on my own, so I'll answer my own question.
The user's environment variables TMP and TEMP can be changed to a Temp folder on the target USB, hence redirecting the matlab downloads straight to USB without filling up local disk in this directory: %AppData%\Local\Temp.
To get to environment variables, control panel search for env, click on change environment variables under System, then you will be in Properties > Advanced, click the button Environment Variables and change both TMP and TEMP to the desired download location. Then press ok, and restart any applications that may be using this.