You gotta chdir to the tmpdir otherwise Windows will complain about deleting files that are in use.