How do I open the “My Documents” and “My Computer” folders from C#?

后端 未结 9 1147
无人及你
无人及你 2020-12-19 20:19

I have used two GUIDs to open the folders My Computer and My Documents.

Process.Start(\"iexplore.exe\", \"::{20d04fe0-3aea-1069-a2d8-08002b         


        
相关标签:
9条回答
  • 2020-12-19 20:37

    Better still would be to skip explorer entirely and just "start" the GUIDs directly:

    Process.Start("::{20d04fe0-3aea-1069-a2d8-08002b30309d}");...

    0 讨论(0)
  • 2020-12-19 20:37

    Have you tried:

    Process.Start("explorer.exe", "::{20d04fe0-3aea-1069-a2d8-08002b30309d}");
    Process.Start("explorer.exe", "::{450d8fba-ad25-11d0-98a8-0800361b1103}");
    

    ?

    0 讨论(0)
  • 2020-12-19 20:43

    Samdoss

    Just enter the

    System.Diagnostics.Process.Start(directoryPath);
    

    Its very easy. Try that.

    0 讨论(0)
  • 2020-12-19 20:49
    System.Diagnostics.Process.Start("...");
    

    I know it looks doubtful but just run it. It'll work. This is the code for my computer. I don't know what it should be for My Documents.

    0 讨论(0)
  • 2020-12-19 20:54

    I had to open MyDocuments and based on comments above I narrowed down the solution to open Explorer without side effects:

    Process.Start("::{450d8fba-ad25-11d0-98a8-0800361b1103}");
    

    I tested it on Windows Server 2008 R2.

    0 讨论(0)
  • 2020-12-19 20:57

    Try explorer.exe:

    Process.Start("explorer.exe", "::{20d04fe0-3aea-1069-a2d8-08002b30309d}");
    Process.Start("explorer.exe", "::{450d8fba-ad25-11d0-98a8-0800361b1103}");
    
    0 讨论(0)
提交回复
热议问题