I only have win2k and outlook 2k, what would be missing for other common environments:

code:
 
OutlookProfile('test','S:\ModProf',,'ExchangeMail',@userid)


function OutlookProfile($ProfileName, $ModProfDir, optional $default, Optional $ExchangeServer, optional $account, Optional $ldapServer)
dim $tempfile, $defaultprofile

$tempfile = '%temp%\modprof.prf'
$DefaultProfile = ReadValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles', "DefaultProfile")
$default = iif($default and not $DefaultProfile = $ProfileName,'Yes','No')

if not keyexist('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\'+$ProfileName)
copy '$ModProfDir\modprof.prf' $tempfile

$ = WRITEPROFILESTRING ($tempfile, 'General', "Custom", "1")
$ = WRITEPROFILESTRING ($tempfile, 'General', "ProfileName", $ProfileName)
$ = WRITEPROFILESTRING ($tempfile, 'General', "DefaultProfile", $default)
$ = WRITEPROFILESTRING ($tempfile, 'General', "OverwriteProfile", "Append")
$ = WRITEPROFILESTRING ($tempfile, 'General', "DefaultStore", "Service2")
$ = WRITEPROFILESTRING ($tempfile, 'General', "UniqueService", "Yes")
$ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service1", "Microsoft Outlook Client")
$ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service3", "Outlook Address Book")
$ = WRITEPROFILESTRING ($tempfile, 'Service3', "Ben", "True")
if $ExchangeServer and $account
$ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service2", "Microsoft Exchange Server")
$ = WRITEPROFILESTRING ($tempfile, 'Service2', "HomeServer", $ExchangeServer)
$ = WRITEPROFILESTRING ($tempfile, 'Service2', "MailBoxName", $account)
endif
if $ldapServer
$ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service4", "Microsoft LDAP Directory")
$ = WRITEPROFILESTRING ($tempfile, 'Service4', "LDAPServer", $ldapServer)
$ = WRITEPROFILESTRING ($tempfile, 'Service4', "SearchBase", right(join(split($ldapServer,'.'),',dc='),-1))
endif
SHELL 'cmd /c $ModProfDir\modprof.exe -P $tempfile -x'
sleep 1
DEL $tempfile
ENDIF
endfunction

_________________________
How to ask questions the smart way <-----------> Before you ask