Search code examples
c#.netvb.netshdocvw

Identify all open System/Special Folders


I am currently using the following to Get Path in a ListBox of all Open Explorer Windows:

foreach (SHDocVw.InternetExplorer j in new SHDocVw.ShellWindows()) {
    if (j.Name == "Windows Explorer") {
        ListView1.Items.Add(j.LocationURL);
    }
}

But it doesn't return the location of special folders like Computer, Recycle Bin, Network etc. Is there a way to identify those folders so I can put the path on my own like shell:MyComputerFolder for Computer?


Solution

  • If j.LocationName was null I compared it with the current system folders' name : Get Current Names of Windows Special Folders, then added the path manually like shell:MyComputerFolder