Question

I need to restart Windows Explorer from my custom installer, but the catch is that I can't simply "kill its process" I need it to close "gracefully" so that it saves its settings.

While doing a search I found out that Windows has this option covered. If you open up the Start menu, then Ctrl+Shift+Right-click on an empty space of the start menu, you'll see a context menu that gives you the "Exit Explorer" command that does exactly what I need.

So I was wondering, is there an API to do that from a program?

Was it helpful?

Solution

The question of how to mimic the behaviour of "Exit Explorer" has been asked already.

But this is not what the installer should do, instead the installer should use Restart Manager Functions.

You can use it for various things depending on your needs:

  • Log out the user and log in again.
  • Close Explorer.exe and start it again.
  • Close services and start them again.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top