PC Review


Reply
Thread Tools Rate Thread

Setting the default mailclient

 
 
Soren Schimkat
Guest
Posts: n/a
 
      21st Sep 2005
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
 
Reply With Quote
 
 
 
 
Carey Frisch [MVP]
Guest
Posts: n/a
 
      21st Sep 2005
Start > Run > %SystemRoot%\system32\control.exe appwiz.cpl,,3

--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User
Microsoft Newsgroups

-------------------------------------------------------------------------------------------

"Soren Schimkat" wrote:

| 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

 
Reply With Quote
 
Soren Schimkat
Guest
Posts: n/a
 
      21st Sep 2005
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.
 
Reply With Quote
 
Carey Frisch [MVP]
Guest
Posts: n/a
 
      21st Sep 2005
How to Register an Internet Browser or E-mail Client With the Windows XP Start Menu
http://support.microsoft.com/default...;EN-US;q297878

--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User
Microsoft Newsgroups

-------------------------------------------------------------------------------------------

"Soren Schimkat" wrote:

| well .. as I wrote, I need to do it without using the gui.
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      21st Sep 2005
Soren Schimkat wrote:

> 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,


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



--
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/scr...r/default.mspx
 
Reply With Quote
 
Soren Schimkat
Guest
Posts: n/a
 
      22nd Sep 2005
Torgeir Bakken (MVP) wrote:
> Soren Schimkat wrote:
>
>> 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,

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



Great .. It looks like the registry keys I needed. Thanks. I will try it
out.

Regards Søren


>
> '--------------------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
>
>
>

 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      22nd Sep 2005
Soren Schimkat wrote:

> Torgeir Bakken (MVP) wrote:
>
>> Soren Schimkat wrote:
>>
>>> 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,

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


Is your Mozilla Thunderbird installation creating the registry key
with subkeys and values:
HKLM\SOFTWARE\Clients\Mail\Mozilla Thunderbird\




--
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/scr...r/default.mspx
 
Reply With Quote
 
Soren Schimkat
Guest
Posts: n/a
 
      22nd Sep 2005
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"


Soren Schimkat wrote:
> 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

 
Reply With Quote
 
Soren Schimkat
Guest
Posts: n/a
 
      22nd Sep 2005
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"

Soren Schimkat wrote:
> 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

 
Reply With Quote
 
Soren Schimkat
Guest
Posts: n/a
 
      22nd Sep 2005
Torgeir Bakken (MVP) wrote:
> Soren Schimkat wrote:
>
>> Torgeir Bakken (MVP) wrote:
>>
>>> Soren Schimkat wrote:
>>>
>>>> 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,
>>>
>>>
>>>
>>>
>>> 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.
>>

>
> Is your Mozilla Thunderbird installation creating the registry key
> with subkeys and values:
> HKLM\SOFTWARE\Clients\Mail\Mozilla Thunderbird\
>


Yes. The installation creates this key.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose mailclient Wouter Windows Vista Mail 3 20th Aug 2007 06:37 PM
Opening Mailclient with MAPI Christof Nordiek Microsoft Dot NET Framework Forms 1 25th Apr 2007 11:30 AM
Mailclient that can add extra headers Shiva Windows XP General 1 22nd Apr 2006 05:21 PM
open default mailclient, attachments Christian H Microsoft C# .NET 1 1st Oct 2004 10:06 PM
Mailclient choice Morgan Ohlson Freeware 55 16th Jul 2004 03:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:11 PM.