Drupal stores some information about themes/modules/theme engines in a table named system. It’s easy to edit manually and shows every single modules that you have installed on the site back to the year dot. Basically, all you have to do in order to make Drupal forget your module is this:
DELETE FROM system WHERE name = 'module_name' AND type = 'module'
Of course, to delete all the related modules and bits + pieces using the like opcode:
delete from system where filename like '%ecommerce%' and type ='module'
So thats the manual method. It’s really nice to cleanup the file. You can do it manually for modules that you want to re-install or just use the DEVEL module.