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:
HKEY_LOCAL_MACHINE\Software\Clients\Mail
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.
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools
{ 6 comments… read them below or add one }
This is nice, I will give it a try.
On our Terminal Servers, we always lose the default mail client.
TRS = 2003 and email is Outlook 2003.
I can make a clean, complete installation of TSR, deploy it and everything is alright.
After that, when make an update to the image and deploy again, we always lose default mail client.
I do not know why this happens.
Gr.
Paul
Just some add,
Maybe you need to add first line as follow :
reg delete HKLM\Software\Clients\Mail /ve /f
This should clean the HKLM\Software\Clients\Mail default value first
@Paul :
As far as i know,
Outlook Express will always replace Microsoft Outlook as default mail client when your GP not setup properly or there was an error in when startup read a registry value to bring outlook as default.
As above mentioned you may use :
reg delete HKLM\Software\Clients\Mail /ve /f
reg add HKLM\Software\Clients\Mail /ve /f /d “Microsoft Outlook”
It should replace the registry.
Hi
How can you set default mail client using the AD login script for non admin user?
http://www.intelliadmin.com/index.php/2007/10/set-the-default-email-client-across-your-network/ your article set this to computer configuration side but I want to run it as normal user on normal user side.
Any help would appriciated.
Regards
Showkat
I found I got a too many command line parameters error. I needed to re-arrange the statement to:
reg add HKLM\Software\Clients\Mail /ve /d “Microsoft Outlook” /f
Actually I found the reason it wasnt working – be careful if you cut and paste the example as it uses alternate quotes “” instead of “”
which will cause an error !