Sign in to follow this  

how to kill explorer.exe from c++

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by streamer
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.


Hmm but here I don't see any KEY that points to explorer.exe

Share this post


Link to post
Share on other sites
If it didn't exist, it was going to use HKEY_LOCAL_MACHINE, but the advantage of setting it for one user is that you can have an administrative account that starts up explorer, and a kiosk account with limited rights (provided by Windows, not hackish mucking about with GINA) that starts up your application.


jfl.

Share this post


Link to post
Share on other sites

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this