streetracerx
MIS
I am trying to create a logon script that will check if user has microsoft outlook already setup and if not then copy the profile file and simply run the newprof.exe using that profile file.
All windows will be win2k, and all outlook are outlook 2000.
Here is what I have so far, but it errors out if I run it. Can anyone help? Most of it is script edited that was posted on this website. I know some C++ so I can somewhat edit it, but I dont know this language so it make it impossible for me to edit it correctly:
Set WSHShell = WScript.CreateObject("WScript.Shell")
Outlookver()
Function Outlookver()
If DetermineObject <> "" Then
Dim X
Set X = CreateObject(DetermineObject)
If Len(X.version) = 10 Then
Select Case Left(X.version,1)
Case "9"
Outlookver = "Outlook 2000"
arr = WSHShell.RegRead("HKCU\Software\Microsoft\Office\9.0\Outlook\Setup\First-Run")
If arr = True Then
WSHShell.Run "v:\newprof\newprof.exe -p h:\outlook\profile.prf",1,True
End If
End If
End Select
Set X = Nothing
End If
End Function
Function DetermineObject()
On Error Resume Next
Dim NEW_OBJ: Set NEW_OBJ = CreateObject("Outlook.Application.11")
Dim OLD_OBJ: Set OLD_OBJ = CreateObject("Outlook.Application")
Dim OLDER_OBJ: Set OLDER_OBJ = CreateObject("Outlook.Application.9")
If IsObject(NEW_OBJ) Then
DetermineObject = "Outlook.Application.11"
ElseIf IsObject(OLD_OBJ) Then
DetermineObject = "Outlook.Application"
ElseIf IsObject(OLDER_OBJ) Then
DetermineObject = "Outlook.Application.9"
Else
DetermineObject = ""
End If
End Function
All windows will be win2k, and all outlook are outlook 2000.
Here is what I have so far, but it errors out if I run it. Can anyone help? Most of it is script edited that was posted on this website. I know some C++ so I can somewhat edit it, but I dont know this language so it make it impossible for me to edit it correctly:
Set WSHShell = WScript.CreateObject("WScript.Shell")
Outlookver()
Function Outlookver()
If DetermineObject <> "" Then
Dim X
Set X = CreateObject(DetermineObject)
If Len(X.version) = 10 Then
Select Case Left(X.version,1)
Case "9"
Outlookver = "Outlook 2000"
arr = WSHShell.RegRead("HKCU\Software\Microsoft\Office\9.0\Outlook\Setup\First-Run")
If arr = True Then
WSHShell.Run "v:\newprof\newprof.exe -p h:\outlook\profile.prf",1,True
End If
End If
End Select
Set X = Nothing
End If
End Function
Function DetermineObject()
On Error Resume Next
Dim NEW_OBJ: Set NEW_OBJ = CreateObject("Outlook.Application.11")
Dim OLD_OBJ: Set OLD_OBJ = CreateObject("Outlook.Application")
Dim OLDER_OBJ: Set OLDER_OBJ = CreateObject("Outlook.Application.9")
If IsObject(NEW_OBJ) Then
DetermineObject = "Outlook.Application.11"
ElseIf IsObject(OLD_OBJ) Then
DetermineObject = "Outlook.Application"
ElseIf IsObject(OLDER_OBJ) Then
DetermineObject = "Outlook.Application.9"
Else
DetermineObject = ""
End If
End Function