Link to home
Start Free TrialLog in
Avatar of Leithauser
Leithauser

asked on

Replacing Explorer.exe

  I would like to be able to replace Windows 2000 Explorer with another program. This is difficult, because Explorer is locked while it is running. Does anyone know a way to do this from within Windows 2000. I have found that it can be done from the DOS prompt (after booting to DOS), but that is not the best solution. Any suggestions on how to unlock a running program so it can be changed from within Win2000?
Avatar of CrazyOne
CrazyOne
Flag of United States of America image

The short answer is no since Explorer is the shell.


The Crazy One
If you want to change the shell you it still requies a reboot. What is it specifically you are wanting repalce Explorer with? Be very careful about messing around with system files.

To change the shell to something differernt you use this key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Shell TheShell

you must make sure the replacement is a true shell and not just a generic program.
If you want to change the shell from the user side you can do it this way.

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

shell  ThePathAndTheShellFileName

You also need to make changes to this key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot

Shell  

Change the SYS portion to USR
Before doing any of this you better save the current registry settings in case you run into problems. Of course change the shell in the Registry requires a reboot.
Avatar of Leithauser
Leithauser

ASKER

    Perhaps a more detailed explanation would help. I currently have a program that replaces the Explorer shell in Windows 95/98/Me. It does this be changing the “Shell=Explorer.exe” line in system.ini with “Shell=MyProgram.exe” during installation and then rebooting. From then on, when Windows runs, there are no icons on the screen and no menu bar at the bottom. The user can only run my program. This is a security program.
   I would like to accomplish the same thing with Windows NT/2000/XP. However, the “Shell=” approach does not work there. I have found that I can accomplish the replacement by booting to DOS with a Windows 98 boot floppy and using “Copy MyProgram Explorer.exe” (after backing up Explorer.exe, of course) and then rebooting, but this is a rather unsatisfactory solution from a setup standpoint.
   What I need is either a way to do this replacement. Some possibilities are:
1) Do the copy MyProgram Explorer from within Windows (which is hard because Explorer is running and therefore locked)
2) A way to change the shell similar to the “Shell=” technique I use with Win 95/98/ME (this might involve changing the register)
3) A way to cause the computer to do the replacement while rebooting such as having my setup program create a temporary AUTOEXEC.BAT FILE that would do the copy before Windows starts, reboot, and then restore the original AUTOEXEC.BAT file
   Any comments would be appreciated. I could also use some clarification of the comment “you must make sure the replacement is a true shell and not just a generic program”. When I did the replacement from DOS my program seemed to work as the shell, although it needs some changes to work properly from Windows 2000/NT/XP.
Well forget about AUTOEXEC.BAT Win2000 doesn't use it.

Why not rename your program to something other than Explorer.exe. Then use the registry settings I mentioned in my prior comments to shell your program?
<<Well forget about AUTOEXEC.BAT Win2000 doesn't use it.>>

   I figured as much.

<<Why not rename your program to something other than Explorer.exe. Then use the registry settings I mentioned
in my prior comments to shell your program? >>

   Sounds like the way to do it. I have little experience in manipulating the registry. Is there an easy API call for doing this change? Obviously, I want to be careful. I program in VB, so please do not give me a C code example. Psuedocode woudl be fine. Also, what files do I need to back up to restore the registry manually if something goes wrong?
Umm Yeah I can give you some sample code although it will be in the Delphi language. Changing registry settings should be pretty straight forward in VB. I am resonably sure you can do it in VB without API's.

Backing up the registry programically in Win2000 is a bit tricky because of permissions but I do have code I use to backup the registry and it works if the permissions are set to allowing access to the hives involved. I have to do something for the next few hours so if you are able to be patient I will get back to you sometime withing the next 8hrs or so. :>)
<<Umm Yeah I can give you some sample code although it will be in the Delphi language. Changing registry
settings should be pretty straight forward in VB. I am resonably sure you can do it in VB without API's.>>

  I do not think that VB has any functions for accessing the registry directly. As for the code, pseudocode would be fine.

Backing up the registry programically in Win2000 is a bit tricky because of permissions but I do have
code I use to backup the registry and it works if the permissions are set to allowing access to the
hives involved. I have to do something for the next few hours so if you are able to be patient I will
get back to you sometime withing the next 8hrs or so. :>)>>

   No rush. Take your time. I plan on taking tomorrow off anyway. Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of CrazyOne
CrazyOne
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept CrazyOne's comment as answer."


Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

JConchie
EE Cleanup Volunteer