Can't really test it but this logic should work, not sure if I missed anything out but:
Code:
Dim objNetwork, strUserName, strDirectory, objFSO
Dim objShell
Dim Version
set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
If objFSO.FileExists("C:\Users\" & strUserName & "\AppData\Local\Microsoft\Outlook\outlook.pst") Then
Else
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Office\14.0\Outlook\Setup"
strValueName = "First-Run"
oReg.GetBinaryValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
Else
objShell.RegDelete "HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\First-Run\"
End If
strValueName = "FirstRun"
oReg.GetBinaryValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue2
If IsNull(dwValue2) Then
Else
objShell.RegDelete "HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\FirstRun\"
End If
objShell.RegWrite "HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\ImportPRF","\\MyServer\Outlook Profiles\CVHS IMAP Profile.prf","REG_SZ"
End IF *Edit - Did a quick check with echo's instead of deletes and seems to work for me. Any luck Randle?
Steve