hello,
i'm stuck, I try to merge the script with another script for Outlook 2003 configuratie but it doesn't work can anyone help me with the script
Code:
FUNCTION ConfigOutlook()
DIM $profile_remove,$deleteitems,$explorview,$editorpref,$prf,$serverloc,$exchangeserver,$ushefolders,$userwinkey,
$machinewinkey,$mofckey,$uofckey,$profilelocation,$scriptdir,$profiledir,$prffile,$ppru,$mses,$exe,$ver,$verchk,$idx,$keyname
$profile_remove='Yes' ; Remove All other Outlook profiles under current user
$deleteitems='No'; Empty Outlooks Deleted Items Folder on Exit
$explorview='Yes' ; Outlook Explorer View 'Yes' or Standard View 'No'
$editorpref='30001' ; Editor Preference 10001=Plain Text, 20001=HTML, and 30001=Rich Text
$prf='outlook.prf'
$serverloc=@lserver+'\Netlogon' ; Outlook Executables files location
$exchangeserver='mailsrvr-01' ; Main Exchange Server Location
$ushefolders='HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'
$userwinkey='HKCU\Software\Microsoft\Windows'
$machinewinkey='HKLM\Software\Microsoft\Windows'
$mofckey='HKLM\Software\Microsoft\Office\'
$uofckey='HKCU\Software\Microsoft\Office\'
IF @inwin=1 ;Windows NT/2k/XP/2003
$profilelocation=$userwinkey+' NT\CurrentVersion\Windows Messaging Subsystem\Profiles'
ELSE ;Windows 9x
$profilelocation=$userwinkey+' Messaging Subsystem\Profiles'
ENDIF
$scriptdir=split('%WINDIR%',':')[0]+':\Scripts'
$prffile=$scriptdir+'\'+$prf
$ppru=$profilelocation+'\'+@userid
$mses=$profilelocation+'\MS Exchange Settings'
$exe=ReadValue($machinewinkey+'\CurrentVersion\App Paths\OUTLOOK.EXE','')
$ver=GetFileVersion($exe)
$verchk=SPLIT($ver,'.')[0]
IF 0=Exist($scriptdir)
MD $scriptdir
ENDIF
IF KeyExist($ppru) OR KeyExist($mses)
RETURN
ELSE
COPY $serverloc+'\'+$prf $scriptdir
PRFSETTINGS($prffile,$exchangeserver,$deleteitems)
IF $profile_remove='YES'
$idx=0
$keyname=EnumKey($profilelocation,$idx)
WHILE @error=0
IF $keyname<>@userid $rc=DelTree($profilelocation+'\'+$keyname)
ENDIF
$idx=$icx+1
$keyname=EnumKey($profilelocation,$idx)
LOOP
ENDIF
SELECT
CASE
$verchk=8 or $verchk=9 ;(e.g. 8.5.5104.0)
OUTLOOK8AND9($verchk+'.0',$scriptdir,$prffile,$mofckey,$uofckey,$serverloc,$explorview,$profilelocation)
RETURN
CASE
$verchk=10 or $verchk=11 ;(e.g. 10.0.2627.1)
OUTLOOK10AND11($verchk+'.0',$uofckey,$prffile,$explorview)
RETURN
ENDSELECT
ENDIF
ENDFUNCTION
; -- OUTLOOK BRANCHOUT FOR OUTLOOK XP/2003 - ALL
FUNCTION OUTLOOK10AND11($vers,$uofckey,$prffile,$explorview)
DIM $rc,$expview
$rc=DelValue($uofckey+$vers+'\Outlook\Setup','First-Run')
$rc=WriteValue($uofckey+$vers+'\Outlook\Setup','ImportPRF',$prffile,'REG_SZ')
SLEEP 1
;If '196610'<>ReadValue($uofckey+$vers+'\Outlook\Options\Mail','EditorPreference')
; $rc=WriteValue($uofckey+$vers+'\Outlook\Options\Mail','EditorPreference','196610','REG_DWORD')
;EndIf
;$pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e6100020000000000000000'
;$pltextfont=$pltextfont+'0000000000201a493a38e9070001000000'
;$rc=WriteValue($uofckey+$vers+'\Outlook\Preferences','TextFontSimple',$pltextfont,'REG_BINARY')
IF $explorview='Yes'
$expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084'
$expview=$expview+'020000dc01000001000000000000000100000000000000c0000000640000001800000003000000'
$rc=WriteValue($uofckey+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY')
ENDIF
IF $vers='10.0'
$rc=WriteValue($uofckey+$vers+'\Outlook\IM','Enabled',0,'REG_DWORD')
ENDIF
ENDFUNCTION
; -- OUTLOOK BRANCH OUT FOR OUTLOOK 98/2000
FUNCTION OUTLOOK8AND9($vers,$scriptdir,$prffile,$mofckey,$uofckey,$serverloc,$explorview,$profilelocation)
DIM $expview,$rc
IF 0=Exist ($scriptdir+'\Profgen.exe')
COPY $serverloc+'\Profgen.exe' $scriptdir
ENDIF
IF 0=Exist ($scriptdir+'\NEWPROF.EXE')
COPY $serverloc+'\NEWPROF.EXE' $scriptdir
ENDIF
IF @inwin=1
SHELL '%COMSPEC% /C '+$scriptdir+'\Profgen.exe '+$scriptdir+'\Newprof.exe -p '+$prffile+' -X -R -L > nul'
ELSE
SHELL '%COMSPEC% /C '+$scriptdir+'\Newprof.exe -p '+$scriptdir+' -X -R -L > nul'
ENDIF
IF @wksta<>ReadValue($uofckey+$vers+'\Outlook','Machine Name')
$rc=WriteValue($uofckey+$vers+'\Outlook','Machine Name',@wksta,'REG_SZ')
ENDIF
IF 1<>ReadValue($uofckey+$vers+'\Outlook','CheckInternetAccounts')
$rc=WriteValue($uofckey+$vers+'\Outlook','CheckInternetAccounts',1,'REG_DWORD')
ENDIF
IF 'False'<>ReadValue($uofckey+$vers+'\Outlook','FirstRunDialog')
$rc=WriteValue($uofckey+$vers+'\Outlook','FirstRunDialog','False','REG_SZ')
ENDIF
IF 1<>ReadValue($uofckey+$vers+'\Outlook\Setup','PrimaryClient')
$rc=WriteValue($uofckey+$vers+'\Outlook\Setup','PrimaryClient',1,'REG_DWORD')
ENDIF
IF 1<>ReadValue($mofckey+$vers+'\Outlook\Setup','MailSupport')
$rc=WriteValue($mofckey+$vers+'\Outlook\Setup','MailSupport',1,'REG_DWORD')
ENDIF
IF 1<>ReadValue($mofckey+$vers+'\Outlook\Setup','First-Run')
$rc=WriteValue($mofckey+$vers+'\Outlook\Setup','First-Run','df83b12adc9cd511b57c0002a57ce19c','REG_BINARY')
ENDIF
;If '196610'<>ReadValue($uofckey+$vers+'\Outlook\Options\Mail','EditorPreference')
; $rc=WriteValue($uofckey+$vers+'\Outlook\Options\Mail','EditorPreference','196610','REG_DWORD')
;EndIf
IF $explorview='Yes'
$rc=WriteValue($profilelocation+@userid+'\0a0d020000000000c000000000000046','001e0360','','REG_SZ')
$expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003'
$expview=$expview+'c030000ac02000001000000000000000100000000000000c00000006400000003000000'
$rc=WriteValue('HKCU\Software\Microsoft\Office\'+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY')
;$pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e6100020000000000000000'
;$pltextfont=$pltextfont+'0000000000201a493a38e9070001000000'
;$rc=WriteValue($uofckey+$vers+'\Outlook\Preferences','PlainTextFont',$pltextfont,'REG_BINARY')
ENDIF
ENDFUNCTION
; -- OUTLOOK PROFILE SETTINGS - ALL >> USED FOR OUTLOOK CONFIGURATION
FUNCTION PRFSETTINGS($prffile,$exchangeserver,$deleteitems)
DIM $rc
; Custom Profile Settings
IF @userid<>ReadProfileString($prffile,'General','ProfileName')
$rc=WriteProfileString($prffile,'General','ProfileName',@userid)
ENDIF
IF 'Yes'<>ReadProfileString($prffile,'General','DefaultProfile')
$rc=WriteProfileString($prffile,'General','DefaultProfile','Yes')
ENDIF
IF 'Yes'<>ReadProfileString($prffile,'General','OverwriteProfile')
$rc=WriteProfileString($prffile,'General','OverwriteProfile','Yes')
ENDIF
IF $exchangeserver<>ReadProfileString($prffile,'Service2','HomeServer')
$rc=WriteProfileString($prffile,'Service2','HomeServer',$exchangeserver)
ENDIF
IF @userid<>ReadProfileString($prffile,'Service2','MailboxName')
$rc=WriteProfileString($prffile,'Service2','MailboxName',@userid)
ENDIF
IF 'TRUE'<>ReadProfileString($prffile,'Service1','AutoNameCheck')
$rc=WriteProfileString($prffile,'Service1','AutoNameCheck','TRUE')
ENDIF
IF 'FALSE'<>ReadProfileString($prffile,'Service1','ConfirmOnDelete')
$rc=WriteProfileString($prffile,'Service1','ConfirmOnDelete','FALSE')
ENDIF
IF $deleteitems='YES'
IF 'TRUE'<>ReadProfileString($prffile,'Service1','EmptyWastebasket')
$rc=WriteProfileString($prffile,'Service1','EmptyWastebasket','TRUE')
ENDIF
ELSE
IF 'FALSE'<>ReadProfileString($prffile,'Service1','EmptyWastebasket')
$rc=WriteProfileString($prffile,'Service1','EmptyWastebasket','FALSE')
ENDIF
ENDIF
IF 'FALSE'<>ReadProfileString($prffile,'Service1','RemoveSchdPlus')
$rc=WriteProfileString($prffile,'Service1','RemoveSchdPlus','FALSE')
ENDIF
IF 'TRUE'<>ReadProfileString($prffile,'Service1','SelectEntireWord')
$rc=WriteProfileString($prffile,'Service1','SelectEntireWord','TRUE')
ENDIF
IF 'TRUE'<>ReadProfileString($prffile,'Service1','CloseOriginalMessage')
$rc=WriteProfileString($prffile,'Service1','CloseOriginalMessage','TRUE')
ENDIF
IF 'FALSE'<>ReadProfileString($prffile,'Service1','GenReadReceipt')
$rc=WriteProfileString($prffile,'Service1','GenReadReceipt','FALSE')
ENDIF
IF 'FALSE'<>ReadProfileString($prffile,'Service1','GenDeliveryReceipt')
$rc=WriteProfileString($prffile,'Service1','GenDeliveryReceipt','FALSE')
ENDIF
IF 'True'<>ReadProfileString($prffile,'Service1','SaveSentMail')
$rc=WriteProfileString($prffile,'Service1','SaveSentMail','True')
ENDIF
IF 'No'<>ReadProfileString($prffile,'General','BackupProfile')
$rc=WriteProfileString($prffile,'General','BackupProfile','No')
ENDIF
ENDFUNCTION
this is a script from this forum
thanks