0

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#?

stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268
cyptus
  • 3,346
  • 3
  • 31
  • 52

1 Answers1

0

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

Community
  • 1
  • 1
Kash
  • 8,799
  • 4
  • 29
  • 48
  • Just as an FYI, `Process.Start` does use `ShellExecute` by default, though it can be made to use `CreateProcess` instead if you use one of the overloads that takes a `ProcessStartInfo`. – Sven Feb 17 '12 at 16:14
  • Thats true. By default the ProcessStartInfo.UseShellExecute is set to true. – Kash Feb 17 '12 at 16:18