Hi guys
I am struggling to put together a script that determines the correct version of Office installed and then to add the appropriate registry key.
Basically I have a prf profile that I need to add to user Outlook accounts. The problem is that on some PCs the prf extension is associated with PicsRules of IE.
I have the regstry settings that make the correct file association:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\prffile\Shell\Open\Command]
@="\"C:\\Program Files\\Microsoft Office\\OFFICE12\\OUTLOOK.EXE\"
/PromptImportPRF \"%1\""
However we have a mix of Outlook 11.0 and 12.0.
so a second regisrty addition:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\prffile\Shell\Open\Command]
@="\"C:\\Program Files\\Microsoft Office\\OFFICE11\\OUTLOOK.EXE\"
/PromptImportPRF \"%1\""
These files are called 12.0.reg & 11.0.reg respectively
They are stored in the NETLOGON folder in a subdirectory call outlook.
I have stringed together a couple of scripts to
1 determine the correct version
and then
2. run the appropriate reg file
This is what I have (as a VBS):
Dim myVariable1
myVariable1 = objword
Set objWord = CreateObject("word.Application", "localhost")
Wscript.Echo "Version: " & objword.Version
objWord.Quit
Set WshShell = WScript.CreateObject("WScript.Shell")
LogonDC= WshShell.ExpandEnvironmentStrings("%logonserver%")
bWaitOnReturn = True
If myvariable1=12.0 Then wshshell.Run "regedit /s " & logonDC & "\NETLOGON\outlook\12.0.reg", _
0,bWaitOnReturn
If myvariable1=11.0 Then wshshell.Run "regedit /s " & logonDC & "\NETLOGON\outlook\11.0.reg", _
0,bWaitOnReturn
Wscript.Echo "SCRIPT COMPLETED "
Can any give any clues on errors or else provide a simpler way to do the job.
Thanks in advance

