Every time I got a new machine or increased the memory capacity I used to add and add more and more hard disks to the latest machine. Now I have several disks of old data (e.g windows installation, program files, etc) plus I started to symlink files and created junctions on those hard disks with actually used data to remove some load from my primary SSD disk of files not used frequently ("C:\ProgramData\Package Cache")
Some programs on those old disks may even be used, e.g no-install versions which I often use via a link on my desktop without remembering where the location actually is and which I probably do not want to delete.
One approach would be to rename all directories and continue to use the machine for several months to see where I stumble upon dead links pointing to the drives in question, but this requires some massive turnaround until I find some (maybe not even all) locations.
Now I am looking for a more aggressive approach. I created a registry search script (https://gist.github.com/Seikilos/ab23cf6b85e1d65936a5) which allows me to search for anything in all hives.
I did this to locate references to a certain old drive but no obviously relevant paths were found (mostly in HKEY_LOCAL_MACHINE\SOFTWARE\Classes). Which makes sense, as I did not install anything on this drives from the current windows installation.
But as written above I know that there are junctions or probably simple links or any other view onto this drive which I did not detect yet and I am looking for a way to check every possibility of having data used on my current installation.
Is there a known way to obtain references, e.g reading file table etc to locate junctions or symlinks?
Update: @and31415 pointed out, that there is a cmd to get all file system level links and junctions. How ever if I have a simple link (ending with .lnk) the dir command does not show it. Argument /AL ignores them at all.
Find .lnk files is not hard, but I would like to be able to resolve them automatically too.