79836415

Date: 2025-12-03 00:05:14
Score: 0.5
Natty:
Report link

The 2nd answer above

d.InitialDirectory = "shell:MyComputerFolder"

works for the new OpenFolderDialog Class in C# Core 8 for WPF

I used it as below

var dialog = new OpenFolderDialog
{
    Title = "Select Root Folder That Contains Media Files and or Subfolder with Files",
     // Sets root to "This PC"
    InitialDirectory = "shell:MyComputerFolder",
    Multiselect = false
};

Thanks user CommonSense

The reason is that IntialDirectory requires a string and MyComputerFolder is a virtual folder which yields an empty string.. and doesn't recognize its special meaning.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Fletch