This is kind of old but I've been hit by the same %TEMP% folder RECOVERY issue described here. Recovery cannot happen since the TEMP folder location is being changed with a numeric following the TEMP, like LOCAL\TEMP\1 or LOCAL\TEMP\2.
I suspect you are checking the %TEMP% variable just once...