If you have a bunch of files whose extensions are missing or incorrect, this button can help.
The button uses the free, small TrID tool to inspect each file, guess its type and append the most likely file extension. Although it is guessing, it is very reliable with image and archive formats.
Note that any existing extension will be left on the file, with the new extension being added after it. You might want to remove existing extensions (e.g. using a trivial wildcard or regexp rename) before using the button.
Getting TrID
TrID can be obtained from here, under the Download heading: mark0.net/soft-trid-e.html
You must download both TrID itself (the Win32 version, trid_w32.zip) and its definitions file (triddefs.zip) and extract them to the same place. If you put them in C:\Program Files\TrID then you won't have to edit the button.
The button
Here is the button code which you can paste to a toolbar or menu:
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Add file extensions</label>
<icon1>#filetype2</icon1>
<function type="batch">
<instruction>"%PROGRAMFILES%\TrID\trid.exe" {filepath$} -ae</instruction>
<instruction>pause</instruction>
</function>
</button>
That's it; now just select some files and click the button.