To move the TEMP directory to another folder/partition/HDD edit the file AUTOEXEC.BAT and insert/update these lines (Best to place them in the top of the file):
Note the temporary directory is a location where files often are created and deleted. Some times it can be useful to move the temporary directory to another location.
REM *** Places all temporary files in the directory D:\TEMP ***
- The partition holding the temporary directory is low on free space.
- File fragmentation introduced by the temporary directory is better placed on another partition.
- There exist another partition which is much faster.
More Info MS KB130075
ECHO Clearing TEMP directory : %TEMP%
DELTREE /Y %TEMP%\*.* >NUL