When I first started doing the groundwork for this article I incorrectly assumed that the default mail client was a setting that each user could change in Windows.
What I mean is – I thought if ‘USER A’ logged in, set the default email client…then ‘USER B’ could login to their account and set their own default email client.
After testing many different ways I have found that it does not work this way at all.
If you are not an administrator, windows will gladly let you go into the internet settings under the control panel – and make the change:
Unfortunately it does not give you an error. If you go back into the settings, it will have reverted back to the original default email client.
This is because the setting is located in the HKEY_LOCAL_MACHINE hive of the registry, and there is no corresponding HKEY_CURRENT_USER entry. If you create one on your own, windows will simply ignore it.
Here is the key for setting the default email client:
If you drop down to this in the registry, you can see that the ‘default’ value on the right is what sets the default email client.
Now, obviously the email client must exist for you to set it. The behavior of windows is undefined if you set it to something that is nonexistent. In other words it might cause some applications to do crazy stuff when trying to access email (If you set it to a client you have not installed on the machine already).
The first step in setting it across our network is to figure out how to set it from the command line. This part is easy. We can use the “REG” command. If you don’t know about it, the REG command allows you to update the registry from the command line. It has been built into windows since XP, and can be added to 2000 by installing the Windows 2000 Resource Kit.
Using the REG command, we create a simple script that looks like this:
reg add HKLM\Software\Clients\Mail /ve /f /d “Microsoft Outlook”
If you are wondering about the command line options -
/ve – this tells it to set the (Default) value for this key
/f – Don’t prompt us, just set it
/d – Following this argument is the data we want to set
In our example we update the machine’s default email client to Microsoft Outlook. You could just as easily set it to Outlook Express.
The big question now is how can I update when most of my users are not an administrator?
Group Policy is our friend.
I am going to open the group policy for my collection of machines I want to update, and drill down to
Computer Configuration -> Windows Settings -> Scripts
This is important. Make sure you do this under Computer Configuration not User Configuration. Otherwise it will be run in the context of the user, and it will fail if they are not an administrator.
When you select it, you will see Startup, and Shutdown on the right. Double click startup. When the properties window shows up, click on Add.
This will open a window that allows you to type the name of the script, and parameters. Click on browse – this will bring you directly where the computer scripts default to. I suggest you create your computer configuration login script right here. Do it by right clicking and creating a new text file. Rename it to logon.bat. Edit it, and paste in the code I showed you above. Now save it….and select it.
Click OK on all of your open windows, and in about 15 minutes your computers should refresh their policy. The next time you reboot the default email client will be updated across your network.