Why do you think that $TemporaryDirectory
is relevant to your problem?
However, if you wish to change the value of $TemporaryDirectory
for a particular Mathematica session then you can simply execute
$TemporaryDirectory="path to a new directory"
since $TemporaryDirectory
is not Protected