سؤال

If I run this command:

C:\WINDOWS\explorer.exe "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{2227A280-3AEA-1069-A2DE-08002B30309D}"

from the Windows shell (via Windows+R), my printer and faxes open in a new explorer.exe process. (So I have 2 running explorer.exe processes.)

If i execute:

Process.Start(@"C:\WINDOWS\explorer.exe", @"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\" + 
                                          @"::{21EC2020-3AEA-1069-A2DD-08002B30309D}\" + 
                                          @"::{2227A280-3AEA-1069-A2DE-08002B30309D}");

from a C# program, my printer and faxes open too, but as an child process of the main explorer.exe process (the one running the Windows shell, including the taskbar, etc.).

What can I do to start a second explorer.exe process with the printer and faxes window from C#?

هل كانت مفيدة؟

المحلول

Initial thoughts - check your "Launch folder windows in a separate process" in Folder Options (Organize -> Folder & Search Options -> View tab). This is unchecked by default, hence "Check" this and try your C# code again.

I know this setting affects the ShellExecute function but I am not sure if .NET's Diagnostic namespace uses the same route.

ShellExecute(handle, "explore", , NULL, NULL, SW_SHOWNORMAL);


Second thoughts - a similar issue has been already discussed in stackoverflow and this post might give you some idea.

Start new process, without being a child of the spawning process

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top