Hi Guys
Can someone tell me how to set the default mailclient by not using the gui?
What I need to do, is to create Mozilla Thunderbird as a selectable
mailclient, and then select Mozilla Thunderbird as the default client.
Can anyone tell me how to do it (through registry, some api or ...) - or
point me to some documentation on how to do it?
Regards Søren
Carey Frisch [MVP] - 21 Sep 2005 13:29 GMT
Start > Run > %SystemRoot%\system32\control.exe appwiz.cpl,,3

Signature
Carey Frisch
Microsoft MVP
Windows XP - Shell/User
Microsoft Newsgroups
-------------------------------------------------------------------------------------------
| Hi Guys
|
[quoted text clipped - 7 lines]
|
| Regards Søren
Soren Schimkat - 21 Sep 2005 13:36 GMT
Carey Frisch [MVP] wrote:
> Start > Run > %SystemRoot%\system32\control.exe appwiz.cpl,,3
well .. as I wrote, I need to do it without using the gui.
Carey Frisch [MVP] - 21 Sep 2005 13:44 GMT
How to Register an Internet Browser or E-mail Client With the Windows XP Start Menu
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q297878

Signature
Carey Frisch
Microsoft MVP
Windows XP - Shell/User
Microsoft Newsgroups
-------------------------------------------------------------------------------------------
| well .. as I wrote, I need to do it without using the gui.
Torgeir Bakken (MVP) - 21 Sep 2005 15:30 GMT
> Hi Guys
>
[quoted text clipped - 3 lines]
> What I need to do, is to create Mozilla Thunderbird as a
> selectable mailclient,
The installation of Mozilla Thunderbird will do this automatically.
> and then select Mozilla Thunderbird as the default client.
>
> Can anyone tell me how to do it (through registry, some api or ...)
> - or point me to some documentation on how to do it?
This VBScript (.vbs) will set Mozilla Thunderbird as the default
e-mail client:
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
sMailtoCmd = RegRead("HKLM\SOFTWARE\Clients\Mail\Mozilla Thunderbird" _
& "\protocols\mailto\shell\open\command\")
If sMailtoCmd <> "" Then
On Error Resume Next
oShell.RegDelete "HKEY_CLASSES_ROOT\mailto\EditFlags"
oShell.RegDelete "HKEY_CLASSES_ROOT\mailto\DefaultIcon\"
On Error Goto 0
oShell.RegWrite "HKEY_CLASSES_ROOT\mailto\", "URL:MailTo Protocol"
oShell.RegWrite "HKEY_CLASSES_ROOT\mailto\URL Protocol", ""
oShell.RegWrite "HKEY_CLASSES_ROOT\mailto\Shell\Open\Command\", sMailtoCmd
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\", _
"Mozilla Thunderbird"
End If
Function RegRead(sRegValue)
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
RegRead = oShell.RegRead(sRegValue)
' If the value does not exist, error is raised
If Err Then
RegRead = ""
Err.clear
End If
' If a value is present but uninitialized the RegRead method
' returns the input value in Win2k.
If VarType(RegRead) < vbArray Then
If RegRead = sRegValue Then
RegRead = ""
End If
End If
On Error Goto 0
End Function
'--------------------8<----------------------
WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp

Signature
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Soren Schimkat - 22 Sep 2005 09:08 GMT
>> Hi Guys
>>
[quoted text clipped - 5 lines]
>
> The installation of Mozilla Thunderbird will do this automatically.
Are you sure? :-)
Offcource I know that .. but i'm creating a tweeked installation based
on the nightly .zip dumps of Thunderbird.
>> and then select Mozilla Thunderbird as the default client.
>>
[quoted text clipped - 3 lines]
> This VBScript (.vbs) will set Mozilla Thunderbird as the default
> e-mail client:
Great .. It looks like the registry keys I needed. Thanks. I will try it
out.
Regards Søren
> '--------------------8<----------------------
>
[quoted text clipped - 42 lines]
> from here if you haven't got it already:
> http://msdn.microsoft.com/downloads/list/webdev.asp
Torgeir Bakken (MVP) - 22 Sep 2005 12:50 GMT
>>> Hi Guys
>>>
[quoted text clipped - 10 lines]
> Offcource I know that .. but i'm creating a tweeked installation based
> on the nightly .zip dumps of Thunderbird.
Is your Mozilla Thunderbird installation creating the registry key
with subkeys and values:
HKLM\SOFTWARE\Clients\Mail\Mozilla Thunderbird\

Signature
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Soren Schimkat - 22 Sep 2005 13:07 GMT
>>>> Hi Guys
>>>>
[quoted text clipped - 14 lines]
> with subkeys and values:
> HKLM\SOFTWARE\Clients\Mail\Mozilla Thunderbird\
Yes. The installation creates this key.
Soren Schimkat - 22 Sep 2005 12:56 GMT
Reading varius documentation, registry capturing and your guys help - I
have created this .reg file that actually works better than the mess
that the Thunderbird installer creates:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\mailto]
@="URL:MailTo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\mailto\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_CLASSES_ROOT\mailto\shell]
[HKEY_CLASSES_ROOT\mailto\shell\open]
[HKEY_CLASSES_ROOT\mailto\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -compose %1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail]
@="Mozilla Thunderbird"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird]
@="Mozilla Thunderbird"
"DLLPath"="C:\\Program Files\\Thunderbird\\mozMapi32.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\Protocols]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto]
@="URL:MailTo Protocol"
"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -compose %1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -mail"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\properties]
@="Thunderbird &Options"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\properties\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -options"
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird\Desktop]
"registeredAsMailApp"="1"
"defaultMailHasBeenSet"="0"
"showMapiDialog"="0"
> Hi Guys
>
[quoted text clipped - 7 lines]
>
> Regards Søren
Soren Schimkat - 22 Sep 2005 13:06 GMT
After having read varius documentation, done some registry capturing and
listening to you guys - I have created this .reg file that actually
works better than the mess that the Thunderbird installer creates:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\mailto]
@="URL:MailTo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\mailto\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_CLASSES_ROOT\mailto\shell]
[HKEY_CLASSES_ROOT\mailto\shell\open]
[HKEY_CLASSES_ROOT\mailto\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -compose %1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail]
@="Mozilla Thunderbird"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird]
@="Mozilla Thunderbird"
"DLLPath"="C:\\Program Files\\Thunderbird\\mozMapi32.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\Protocols]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto]
@="URL:MailTo Protocol"
"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\DefaultIcon]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\Protocols\mailto\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -compose %1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\open\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -mail"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\properties]
@="Thunderbird &Options"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla
Thunderbird\shell\properties\command]
@="C:\\Program Files\\Thunderbird\\Thunderbird.exe -options"
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird\Desktop]
"registeredAsMailApp"="1"
"defaultMailHasBeenSet"="0"
"showMapiDialog"="0"
> Hi Guys
>
[quoted text clipped - 7 lines]
>
> Regards Søren