how to kill explorer.exe from c++

Started by
12 comments, last by streamer 16 years, 11 months ago
Hi. For my program I need explorer.exe not to run in background. I tried several methods, shortest is: ShellExecute(g_hWnd, "open", "tskill explorer.exe", NULL, NULL, SW_SHOWNORMAL); but as many different methods I tried, next thing happen. Explorer.exe shuts itself down.... for a cc. 3 sec and then restart itself. But if kill explorer.exe from task manager he is killed until I run explorer.exe task again. On any other process this works, only on explorer.exe don't. Seems that windows doesn't like if explorer task isn't running. Any idea?
Advertisement
Why do you need explorer not to run? Disabling it means you can't navigate the file system and such from the GUI: no start menu, no task bar...

-me
Windows was probably built with the function to restore explorer back to running when it shuts down.
Having to kill another process as part of your program is usually a very bad sign, and indicates that there are probably other methods already available in the OS for doing what you ultimately want without such hacks.

So, why does the program need explorer.exe to be dead?
Quote:Original post by Palidine
Why do you need explorer not to run? Disabling it means you can't navigate the file system and such from the GUI: no start menu, no task bar...

-me


That's why [smile].
My customers tend to go out from program, then mess up a whole windows, and then cry for help.
This implementation would make them ASK first. For example I have a nice settings menu with lot of options, that I made for them to make they life easier.
But after some of them removed vital files from system, a whole windows crashed, I thought that this could be very nice trick.
Also these mans are simple workers. No knowledge of windows at all.
Oh and I forgot to mention that only THIS program run on computer, nobody need to go out from program. When windows start only this program starts. When they shut down the program they shut down a whole system.
But there are alway smart people who want to hack the program, mess things up.
I want to prevent this.
You can disable that functionality without killing the explorer process. Killing the explorer process is bad.

Information could be found somewhere here:
http://msdn.microsoft.com

Killing the process won't work for you anyway. They can just open the task manager -> right click -> start explorer.

-me
Then you are looking at the wrong thing. You want to set the shell as your program. This can be done from the Windows registry:

HKEY_USERS\<the user you want>\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

and set Shell to point to your application. This is usually what is done in kiosks.


jfl.
Quote:Original post by Palidine
You can disable that functionality without killing the explorer process. Killing the explorer process is bad.

Information could be found somewhere here:
http://msdn.microsoft.com

Killing the process won't work for you anyway. They can just open the task manager -> right click -> start explorer.

-me


hehe no task manager. I worked around the GINA.

Quote:Original post by jflanglois
Then you are looking at the wrong thing. You want to set the shell as your program. This can be done from the Windows registry:

HKEY_USERS\<the user you want>\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

and set Shell to point to your application. This is usually what is done in kiosks.


jfl.

Thanks for point me out this.

This topic is closed to new replies.

Advertisement