Saving temp files in a different location?

While running my renders, temp files are by default getting saved in AppData\Roaming\McNeel\Rhinoceros\5.0\UI\Temp\

Is there a way I can change the location where I want temp files to get saved? Also, is there some automated way I can delete the contents of the temp folder during script run-time?