Subscribe

Get the Network Administrators tool pack

Subscribe to our 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

Recent Posts

Search

Archives

Set the default email client across your network

by Steve Wiseman on October 30, 2007 · 6 comments

in Windows


.

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:

Set Default Email Client

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.

Set Defalt Email Client Registry

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.

Computer Configuration Startup Script

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.

Add Computer Startup Script

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.

Select Logon Script

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

Related Articles:

{ 6 comments… read them below or add one }

1 Paul June 1, 2010 at 6:37 am

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

2 Janel Runtu June 6, 2010 at 12:01 am

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

3 Janel Runtu June 6, 2010 at 12:07 am

@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.

4 Showkat October 29, 2010 at 5:28 pm

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

5 Summerisle September 20, 2011 at 9:37 am

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

6 Summerisle September 20, 2011 at 10:26 am

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 !

Leave a Comment

Category Links - Windows Forum - Exchange Forum