Search This Blog

Monday, April 21, 2008

Deleting Obstinate AVI Files

Have you ever had the problem that whenever you click on a particular, large AVI file (700 MB or bigger), Windows stops responding, with the CPU jumping to 100% usage? You can neither view the video, nor rename it, nor move or delete it. And this becomes an even bigger problem when you may have many files in a folder with thumbnail view on.

This problem generally occurs because the large AVI (700 MB is considered large) has no indexing information; it is absent in the file. Due to this, Windows tries to process each and every sector of the file to acquire the information, which can take a very long time - up to two hours or more.

So what makes an AVI corrupt?

1. The AVI structure might have gotten corrupted during download.
2. Partially downloaded files are considered corrupt as they are incomplete (but are still viewable many a time).
3. Some codecs or conflicting codecs (those that let the player play the movies) can cause this behaviour to occur.

There are several ways of fixing this but before I mention the tip to rectify the problem, note that these ways are unsupported by Microsoft; if you continue, you'll be doing so at your own risk. Nevertheless, this tip has been tried and tested. If you are more technically inclined, you can read it at the Microsoft site -- it's a solution suggested by the community. Microsoft recommends fixing this issue and a whole lot of others by updating to the latest Service Pack through Windows Update. If you have no patience for that -- it can take hours if you haven't kept abreast with the latest patches -- here is the manual way.

What this (manual) way does is, it removes the previewing of media files altogether (that means no thumbnails); this applies to only media files such as audio and video, and not photo files such as JPG, BMP, GIF, or PNG.

To remove previewing of media files:

1. Click Start | Run



2. Type in regsvr32 /u shmedia.dll. Click OK.



3. In an instant, you will get a dialog with the message "DllUnregisterServer in shmedia.dll succeeded."

To re-enable previewing of media files, do the same, except that you should now type in regsvr32 shmedia.dll. It's the same text without the /u.

You can do the same for photo formats if you like:
To remove photo preview, run regsvr32 /u shimgvw.dll.
To re-enable photo preview, type in regsvr32 shimgvw.dll (without /u).

This is a blanket solution which cures any and all problems associated with previewing media files, whether it is video or audio. If the problem started to occur after, say, installing a different codec pack to view a movie, simply removing the codec pack in question should solve the problem.

If you don't want to disable and re-enable previewing of files, there is another solution that requires Registry-tweaking. What we are going to do in this solution is, allow us to access the file in question without Explorer crashing. Access equals clicking on the file, renaming it, moving it, or deleting it.

1. Click on Start | Run



2. Type in regedit and press OK.



3. What you need to look for is this PropertyHandler key under HKEY_CLASSES_ROOT. The easiest way to do this is to right-click on HKEY_CLASSES_ROOT, click Find, and type in SystemFileAssociations with no spaces.

4. Once regedit finds this, you need to go to PropertyHandler a few folders below. Therefore the entire path would be HKEY_CLASSES_ROOT\SystemFileAssociations\.avi\shellex\PropertyHandler.



5. In the right pane, right-click on Default, hit Delete, and then Yes to confirm. You'll need to close any open programs and restart the PC.

Personally, I prefer disabling preview of media files while keeping photo previews on, as previewing video files is just plain useless. When videos are previewed, basically only the first frame of the video appears, which may be plain black due to the fade-in effects. Plus, disabling preview speeds up browsing in the folder, and it's a lot safer to use a non-Registry trick. Nevertheless, it's a personal choice; feel free to use either of the methods.

No comments: