You can't change it, but you can hide it and add something that looks like it

Raymond Chen

Today we have another case of “Now you have two problems.” The corporate customer already solved their problem halfway and needed help on the other half. The impossible half.

We want to change the Add or Remove Programs icon in the Windows XP control panel so it runs our custom install management program instead of running the one built into Windows. In other words, we want to change what happens when the user clicks the Add or Remove Programs icon. Is this possible?

What they specifically request isn’t possible because the icon is provided by Add or Remove Programs itself, but you can easily get the same effect. This is why it’s important to understand why somebody wants to do something even though they are asking how to do it. Once you understand why they’re doing something, you can unwind the steps they’ve taken and come up with something that doesn’t answer the specific question but still solves the bigger problem.

You can’t redirect an icon but you can remove the existing icon and replace it with something else. Set a policy to remove the existing Add or Remove Programs icon from the control panel and then write your own control panel called Add or Remove Programs.

I’m not sure what happened next, but they acted as if I wrote, “Could you please repeat the question?”

Raymond, we need to replace the link in the Control Panel with a custom program that elevates the user’s privileges so that they can manage the programs on the computer. Is there any registry key or setting that specifies how the control panel applet is launched that we could inject an EXE into? This EXE would just be a wrapper for launching the original CPL.

I’m assuming that the extra wrinkle of “And then we want to re-launch the original CPL” made them think their situation was somehow special, so that regular-grade advice wasn’t good advice. They needed premium.

You can still follow the original suggestion. Remove the original CPL via policy and add your custom EXE (which then launches the original CPL after doing whatever it wants).

But no, that wasn’t the problem. They simply missed the point entirely. They were so focused on looking for the sentence “Here is how you change what the icon launches” that they completely missed the point of the suggestion. They’re looking for a solution to the specific problem instead of the bigger problem.

How do you configure the policy to launch our EXE instead of the CPL?

At this point I pulled out my bad analogy gun.

In your car there is an ignition switch. It is wired to the starter. You want to make the driver take a breathalyzer test before they can start the car.

Plan A (what you are proposing): Patch into the wire connecting the ignition switch to the starter so it goes through a breathalyzer. Unfortunately the wire is sheathed in kevlar and cannot be cut open. The designers of the wire did not include any hooks for breathalyzers.

Plan B (my suggestion): Remove the old ignition switch and install a new ignition switch that is connected to a breathalyzer. If the driver passes the breathalyzer test, then your ignition switch turns the original ignition switch. Notice that this method doesn’t require you to bust open the kevlar sheathing that protects the wire between the old ignition switch and the starter.

All the driver sees is a keyhole. They stick the key in and turn the key. If you’re really clever you make your new ignition switch’s faceplate look just like the original so the driver can’t tell the difference between the two methods (all they see is a keyhole, a breathalyzer, and if they pass, the car starts).

  • The existing CPL is the old ignition switch.
  • Your replacement program is the new ignition switch.
  • Deploying the Hide the Add or Remove Programs control panel policy is removing the old ignition switch.
  • The Add or Remove Programs icon is the keyhole.
  • The way Windows XP works, the keyhole leads to the old ignition switch.
  • Plan B: Use policy to remove the old ignition switch, and install new ignition switch (your replacement program). Use some paint to make the new keyhole look just like old keyhole. The person in driver’s seat is none the wiser.

You know you’re in trouble when I have to pull out my bad analogy gun.

Note: I don’t know whether this trick will actually work, but it seemed a useful example of the principle of “Just because it has to look like something doesn’t mean it has to be that something.”


Comments are closed. Login to edit/delete your existing comments

Feedback usabilla icon