Search code examples
c#.netwindowscmdwindows-10

Why does the same command work differently from CMD vs Process.Start()?


The following command used in CMD or Win+R opens the screensaver dialog:

control desk.cpl,screensaver,@screensaver

The following does a similar thing, but most screensavers are missing from the drop-down (Only (None), Blank, and Photos available):

Process.Start("control.exe", "desk.cpl,screensaver,@screensaver");

Why?

(And, obviously, how can I get the CMD result using C#/.Net?)


Solution

  • The difference is in the bitness of the launching application. 64-bit explorer launching 64-bit control panel gets the full list.

    An application running as 32-bit launches 32-bit control panel and gets the truncated list. And the same application running as 64-bit gets the full list again.

    So the "obvious" fix is to change your project's properties to build for x64.