How do I open the “My Documents” and “My Computer”

2019-01-26 21:17发布

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

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

But it opens Internet Explorer and then opens the folders My Computer and My Documents.

标签: c# shortcut
9条回答
叼着烟拽天下
2楼-- · 2019-01-26 22:02

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.

On Windows 7 this results in opening the folder from where your executable is running, i.e. the "current" folder.

查看更多
可以哭但决不认输i
3楼-- · 2019-01-26 22:05

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

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

查看更多
欢心
4楼-- · 2019-01-26 22:06

Have you tried:

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

?

查看更多
登录 后发表回答