Widgets for Microsoft Exchange
MAPI Logon


MAPI Logon Utility

Ever wished you could specify Exchange's profile on its command line? That way you could open a shortcut from the desktop and never interact with the "Choose Profile" dialog, going instead directly to mail. MAPI Logon does just that.

Requirements and contraindications

MAPI Logon can only start Microsoft Exchange or Windows Messaging. It does not start Microsoft Outlook 97. Outlook already supports loading a particular profile via its /profile switch.

MAPI Logon no longer supports the first beta of Windows NT 4.0.

The Microsoft Internet Mail MAPI transport service provider (minet32.dll) released with Windows 95 Plus! and the Microsoft Internet Explorer is not as robust as it might be. MAPI Logon can confuse this transport enough that it will not transmit messages, and may even hang the MAPI message spooler completely. See the Bugs and Shortcomings section below for the precise error messages and workarounds.

Since the number of keystrokes you save through MAPI Logon is less than the number of keystrokes you will need to work around these bugs, when they bite, I do not recommend MAPI Logon with Internet Mail on Windows 95. (Of course, if you can get it to work, more power to you.)

The Windows Messaging client setup program on Windows NT 4.0 writes a couple of invalid entries to the system registry that will interfere with the correct operation of MAPI Logon. Again, see the Bugs and Shortcomings section below for the precise error messages and workarounds.

Installation

Download mlogon.zip (available in both Intel and Alpha flavors) from this Web page, and unzip it. Copy the executable mlogon.exe anywhere that you like. Check your system directory for the file msvcrt40.dll on Alpha, or msvcrt.dll version 4.20.6201 on Intel; if you lack this, see the runtime installation instructions. MAPI Logon requires no further installation.

De-installation

Delete the file mlogon.exe, together with any shortcuts or batch files that reference it.

Usage

MAPI Logon is designed to work from desktop or folder shortcuts. It accepts a number of command-line switches that control its behavior.

The /p switch is mandatory, naming the profile to use for logon. If the name of the profile contains spaces, surround it with quotes. E.g. mlogon /p "Internet Mail Settings" starts Exchange with the Internet Mail Settings profile.

The /c switch allows you to specify a credential string for use at logon. Most systems do not use this.

The /e switch allows you to specify additional switches to pass to Exchange at its startup, such as the /a switch that produces the Address Book instead of Exchange. E.g. mlogon /p CIS /e /a starts Exchange with the CIS profile, specifying that Exchange is to show the Address Book instead of the mail window.

The /? switch gives a brief summary of the program.

To use MAPI Logon as the destination of an Explorer SendTo action, create a batch file consisting of the following three lines:

@echo off
mlogon /p profilename /e %1
exit

Then create a shortcut to this batch file, and place it in your \windows\SendTo folder. This will let you send to a mail recipient while specifying the profile to use.

Known shortcomings and bugs in this release

If you ever issue the Tools.Deliver Now message only to have it fail with the error message -- The command you specified could not be carried out. The action could not be completed. Microsoft Exchange Client - 9997 - [80040106] -- simply quit Exchange and restart it (through MAPI Logon if you like), whereupon you can resume transmitting or receiving messages. This appears to be a bug in the Microsoft Internet Mail transport for Windows 95.

On the Windows 95 clients released with Microsoft Exchange Server, or on the Windows Messaging upgrade for Windows 95, this problem worsens: using MAPI Logon to start Exchange with a profile containing Internet Mail frequently hangs the MAPI message spooler daemon process. When this happens, Exchange will disable its Deliver Now menu item, and new messages will not arrive or depart. If this happens, you must exit Exchange, manually kill the stuck spooler process, and then restart Exchange. To release the stuck spooler from its misery, press Ctrl-Alt-Del to view the task list, select the row corresponding to the spooler ("Mapisp32"), and issue the End Task command.

Sometimes by changing the behavior of MAPI Logon you can tiptoe around these bugs. To try this, create the following key in your registry:

HKEY_CURRENT_USER\Software
 \Angry Graycat Designs
  \MAPI Logon
   \0.2

Within this key, creating the DWORD value Sleep will force MAPI Logon to pause for a while before it pulls the plug on itself. Try the values 5000, 10000, 15000, and 30000. (These are millisecond counts). Another DWORD value MountStore, if specified, will force MAPI Logon to mount the default store before kickstarting Exchange. There are no right or wrong settings for these values. The object of the game is simply to find a combination that avoids the timing bug on your system.

On Windows NT 4.0, the Windows Messaging setup program creates a couple of incorrect entries in the system registry, causing MAPI Logon to fail with the following diagnostic: Failed starting the executable for the Microsoft Exchange mail client, or for Windows Messaging. To correct this, open the registry editor, visit the key

HKEY_LOCAL_MACHINE\Software
 \Microsoft
  \Windows
   \CurrentVersion
    \App Paths
     \EXCHNG32.EXE

and remove any extraneous double-quote characters from the values in the right-hand pane.

If you are running the Exchange Server release of the client, and you see the client presenting the Choose Profile dialog in spite of your using MAPI Logon, check the registry key

HKEY_LOCAL_MACHINE\Software
 \Microsoft
  \Exchange
   \Client
    \UpgradePath

and delete any value you find there,. particularly if this key names a server that does not exist on your LAN,

Change history


Other destinations

Widgets
Go to the main Widgets for Microsoft Exchange page
Home
Go to Ben Goetter's personal page
Site Map
Find your way around this site

Last modified: 13 August 1998

Ben Goetter (contact information)

Copyright 1996-1998 Ben Goetter. All rights reserved.