I get around this by starting Calibre with a batch file that (amongst other things) contains the following:
Code:
SET CALIBRE_TEMP_DIR=%TEMP%\CALIBRE_TEMP
ECHO TEMPORARY FILES: %CALIBRE_TEMP_DIR%
IF EXIST "%CALIBRE_TEMP_DIR%" RMDIR /s /q "%CALIBRE_TEMP_DIR%"
MKDIR "%CALIBRE_TEMP_DIR%"
REM set the following for any components that do
REM not obey the CALIBRE_TEMP_DIR setting
SET TMP=%CALIBRE_TEMP_DIR%
SET TEMP=%CALIBRE_TEMP_DIR%
This does not mean that calibre cannot leave temporary files behind in any particular run, but it does mean that any calibre temporary files left from previous runs are removed before starting up calibre again.
This technique is also used in the "Calibre Portable.bat" file that is included with Calibre.
I hope this helps.