Tuesday, August 28, 2007

Why avi files get locked and how to delete locked files ?

First we should know why files get locked?
this is caused by the Windows XP Shell Media Extension (shmedia.dll), which provides statistics and thumbnails for media files. Problem is, sometimes shmedia gets stuck on a file, and since it runs inside of Explorer, that file is effectively locked until you restart or logoff. And even that doesn't help, because after restarting, opening the folder causes it to lock the file again. Using Process Explorer from sysinternals.com is the easiest way to confirm that Explorer is holding the file open.

Deleting the file via the command-line, rather than navigating to the folder in Explorer, should work.
If you're not a fan of the command-line and don't DEL the file that way, an alternative solution is to temporarily unregister shmedia.dll (regsvr32 /u shmedia.dll), restart, delete the file, and then re-register the extension (regsvr32 shmedia.dll). This is cleaner than hacking the registry to blow away the extension. I always just leave it unregistered, though, because I don't need it.

No comments:

Removing audio noise from a video

The basic steps are to extract the audio, remove noise, and then re-insert the noise-free audio back into the video wrapper. Step I: Ext...