Willem,
After we had a short chat, I found a program called 'MIDIUTIL 1.0' on the web. This is a great tool to get rid of duplicate midifiles.
It works VERY fast and scans my entire midifolder (30,000 files) in about 5 minutes. Duplicates (in my case 2000) are easy to remove.
Roel