Trying to figure out if a file is in a folder that has been subst'd or is located in a user folder using C#
If Subst is run without parameters it produces a listing of all current substitutions. Get the list, check your directory against the list.
There is also the issue of mapping a volume to a directory. I have never attempted to detect these but the mount point directories do show up differently than regular directories so they must have a different attribute of some kind and that could be detected.
I think you have a few choices --
Via System.Management classes: http://briancaos.wordpress.com/2009/03/05/get-local-path-from-unc-path/
Or
Via P/Invoking this MAPI function: ScUNCFromLocalPath http://msdn.microsoft.com/en-us/library/cc842520.aspx
I think you need to P/Invoke QueryDosDevice() for the drive letter. Subst drives will return a symbolic link, similar to \??\C:\blah. The \??\ prefix indicates it is substituted, the rest gives you the drive+directory.