This question already has an answer here:
Is there a good way/application to get a good overview of which folders on a computer contains installed applications? The scenario could be something like this
On a computer a bunch of application are installed in C:\Program Files. On the same machine there is a folder named D:\Program Files. I would like to quickly find out which, if any, installed applications happen to be installed in D:\Program Files. We can not assume that all applications located in the folder are installed but might very well be remnants of some old Windows installation no longer in use so the installed applications must somehow be scanned one by one and there installation folder marked somehow.
The rationale would be to be able to safely remove old installed applications not actually installed on this installation of Windows but that has somehow remained on disk.