Can anyone help/point me in the right direction. I have basic knowledge of coding and I am trying to run a script that will check what version of Outlook that and end user has (Outlook 2013 or 2010). Then depending on what version the user has, it will create a new email profile. I have found a few different scripts and tried to mash them together but I keep getting errors.
My effort is as follows:
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Outlook.Application\CurVer"
strValueName = ""
oReg.GetStringValue HKEY_CLASSES_ROOT, strKeyPath, strValueName, strValue
WScript.Echo strValue
If strValueName >= 15 Then
"HKCU\Software\Microsoft\Office\" & strValueName & ".0\Outlook\Profiles\" _
& ProfileName & "\New_O365_1"
"HKCU\Software\Microsoft\Office\15.0\Outlook" /v DefaultProfile /t REG_SZ /d "New_O36_1" /F
Else
reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" _
& ProfileName & "\New_O365_1"
reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles /v DefaultProfile /t REG_SZ /d "New_O365_1" /F"
reg add "HKCU\Software\Microsoft\Exchange\Client\Options /v PickLogonProfile /t REG_DWORD /d "0" /f"
End If
I have also tried running the If
with add reg
included but it fails.