Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me fix this logon script to setup MIcrosoft Outlook (gets error).

Status
Not open for further replies.
Joined
Sep 23, 2004
Messages
1
Location
US
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



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top