View Single Post
  #2  
Old April 12th 19, 11:15 PM posted to microsoft.public.windowsxp.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default Cleanly ending explorer.exe without getting a reboot dialog ?

On Fri, 12 Apr 2019 10:54:11 +0200, R.Wieser wrote:
Hello all,

I have a need to terminate the "desktop" (explorer.exe) cleanly, allowing it
to write its settings to the registry (to than overwrite some of those
:-) ).

The problem is that when I "taskkill /im explorer.exe" I get a "Turn of
computer" dialog, which I cannot use.

I can ofcourse get rid of that "turn of" dialog by adding the "/f" argument
to the above taskkill command, but than the programs current settings are
discarded (not written to the registry).

I've also been googeling for a way to ask the explorere.exe proces to
"flush" its settings, but didn't find any leads.

In short, I've got a catch-22 on my hands. Does anyone have an idea how
to break it ?

Regards,
Rudy Wieser


Just found out that posting WM_QUIT to the Progman window cleanly shutdown
the desktop process without showing any dialog. The desktop process does the
normal registry writes like it does when pressing the shutdown dialog's
Cancel button while the CTRL+SHIFT+ALT keys are held down. i.e. ShellBags
and CleanShutdown registry values.

FYI, posting WM_CLOSE to the Progman window caused it to show the shutdown
dialog, while WM_SYSCOMMAND(SC_CLOSE) does nothing.
Ads