External requirements:
- newprof.exe (creates the new profile)
- prfpatch.exe (resolves the variables used in .prf file)
Should be available at MS if not just ask.
code:
;SetConsole ("HIDE")
? "** Starting Automatic MS Outlook Profile Creation..."
? "** Checking if Outlook is installed..."
$1 = Exist ("c:\program files\microsoft office\office\outlook.exe")
If ($i1 = 1) Goto Check_Profile
Else
? "** Outlook is NOT installed, skipping to end of script..."
Goto End
;
:Check_Profile
? "** Checking if userprofile exists..."
$2 = Exist ("%userprofile%\application data\microsoft\outlook\%username%.fav")
If ($2 = 0) Goto Copy_Profile
else
? "** Outlook profile found... skipping to end of script..."
Goto End
:Copy_Profile
? "** Copying Default Outlook Profile..."
Select
Case Ucase(@HOMESHR) = "\\nt1\users"
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "olp_rotterdam.prf " + "%windir%\outlook.prf > NUL"
Case Ucase(@HOMESHR) = "\\amssvr01\users"
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "olp_amsterdam.prf " + "%windir%\outlook.prf > NUL"
EndSelect
? "** Creating new Outlook profile based on current user..."
Shell "%COMSPEC% /E:1024 /C " + @LDRIVE + "prfpatch.exe"
Shell "%COMSPEC% /E:1024 /C " + @LDRIVE + "newprof.exe -p %windir%\outlook.prf"
:end
As you can see in the script I use two prf files. This is because of the locations we have and some deferent settings for them. The prf files are created with the custom installation wizard included in the office resource kit.
As I earlier said the nbewprof.exe can be used on outlook XP (2002). I checked with Microsoft and they confirmed it.
When using Outlook XP you should create or set the ImportPRF key in HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\setup to the path where the processed prf file is located.
[ 09. August 2003, 15:07: Message edited by: R2D2 ]
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.