Deleting files and folders used by other processes on Windows
byte8bits at gmail.com
Wed Jul 18 22:09:55 CEST 2007
tkondal at gmail.com wrote:
> I have been looking into making my file cleaning script more
> intelligent. The goal of the script is to delete everything on a
> drive except for a couple of folders which are skipped by the script.
> Recently, I noticed that some files where not being deleted because a
> process was using them.
# Make the file's attributes normal so file can be
win32api.MoveFileEx(os.path.join(root, f), None,
except Exception, e:
Upon reboot the file will be gone... careful though, this canl delete
any Windows system file too.
More information about the Python-list