

Select a track with an exclamation mark, use Ctrl-I to Get Info, then click No when asked to try to locate the track. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, or the drive it lives on has had a change of drive letter, or you've moved a non-portable library to a different path (see Make a split library portable for details).

The "missing file" error happens if the file is no longer where iTunes expects to find it.
