Hello all... I am a totally new to scripting so please be patient
I need this script to check what version is on outlook and if it’s the right version delete a key and then write a key. I am getting an error on line 20 *invalid char* and I need help
Option Explicit
On Error Resume Next
Dim O2K3
Dim OXP
Dim O2K
Dim WshShell
Dim Profile
Set WshShell = WScript.CreateObject("WScript.Shell")
Set O2K3 = 0
Set OXP = 0
Set O2K = 0
O2K3 = WshShell.RegRead("HKCU\SOFTWARE\Microsoft\Office\11.0\Common\ProductVersion\ProInfo")
OXP = WshShell.RegRead("HKCU\Software\Microsoft\Office\10.0\Common\UserInfo")
O2K = WshShell.RegRead("HKCU\Software\Microsoft\Office\9.0\Common\UserInfo")
If O2K3=1 then WScript.Echo "Detected Outlook 2003"
WshShell.RegDelete "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\First-Run"
WshShell.RegWrite "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\ImportPRF","\\dsfin\finhome\outlookprf\Outlook-2003.PRF","REG_SZ"
else If OXP=1 then
WScript.Echo "Detected Outlook XP"
WshShell.RegDelete "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\First-Run"
WshShell.RegWrite "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\ImportPRF","\\ dsfin\finhome \outlookprf\Outlook-XP.PRF","REG_SZ"
else if O2K=1 then
WScript.Echo "Detected Outlook 2000"
WshShell.Run "\\dsfin\finhome\OutlookPRF\NEWPROF.EXE -p \\dsfin\finhome\OutlookPRF\Outlook.prf", 0, True
end if
end if
end if
end if
end sub
check
I need this script to check what version is on outlook and if it’s the right version delete a key and then write a key. I am getting an error on line 20 *invalid char* and I need help
Option Explicit
On Error Resume Next
Dim O2K3
Dim OXP
Dim O2K
Dim WshShell
Dim Profile
Set WshShell = WScript.CreateObject("WScript.Shell")
Set O2K3 = 0
Set OXP = 0
Set O2K = 0
O2K3 = WshShell.RegRead("HKCU\SOFTWARE\Microsoft\Office\11.0\Common\ProductVersion\ProInfo")
OXP = WshShell.RegRead("HKCU\Software\Microsoft\Office\10.0\Common\UserInfo")
O2K = WshShell.RegRead("HKCU\Software\Microsoft\Office\9.0\Common\UserInfo")
If O2K3=1 then WScript.Echo "Detected Outlook 2003"
WshShell.RegDelete "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\First-Run"
WshShell.RegWrite "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\ImportPRF","\\dsfin\finhome\outlookprf\Outlook-2003.PRF","REG_SZ"
else If OXP=1 then
WScript.Echo "Detected Outlook XP"
WshShell.RegDelete "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\First-Run"
WshShell.RegWrite "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\ImportPRF","\\ dsfin\finhome \outlookprf\Outlook-XP.PRF","REG_SZ"
else if O2K=1 then
WScript.Echo "Detected Outlook 2000"
WshShell.Run "\\dsfin\finhome\OutlookPRF\NEWPROF.EXE -p \\dsfin\finhome\OutlookPRF\Outlook.prf", 0, True
end if
end if
end if
end if
end sub
check