OK So Ihave modified my client script to now check that client startup if the installed version matches the script version and it works nicely. thanks rbanse.
here it is................
'=======================================================================
' AUTHOR: Roger Truss
' COMPANY: Brunswick Corporation
' DATE: 07/26/2010
' COMMENT: This Script installs the SCCM Client
'=======================================================================
'***********************************************************************
' settings and variables section
'***********************************************************************
on error resume next
Set wshShell = CreateObject("Wscript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objWMIObjects = objService.InstancesOf("Win32_Process")
DIM sSetup, oArch, sCcmExecPath
Dim objWMI, objList, objItem
sSystemRootKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot"
sSystemRoot = WshShell.RegRead(sSystemRootKey)
Set colItems = objService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
oARCH = Left(objItem.SystemType,3)
next
'**************************
' Package naming structure.
'**************************
sInstalledFrom = "WEB" '"web" or "sms" or "ris" or "manual" or "CD"
sInstallType = "Setup" '"setup" or "update" or "remove" or "upgrade"
sInstallVer = "2007"
sInstallName = "SCCM"
sInstallMaker = "Microsoft"
sClientVer = "4.0.6487.2000"
Select Case LCase((oArch))
Case "x86"
sCcmExecPath = ssystemroot & "\System32\CCM\ccmexec.exe"
Case "x64"
sCcmExecPath = ssystemroot & "\SysWOW64\CCM\ccmexec.exe"
Case Else
whsShell.LogEvent 1, "Setup could not detect Processor Type, installation can not continue on a " & UCase(oArch) & " based system."
Wscript.quit(1)
End Select
If oFSO.FileExists(sCcmExecPath) Then
sCcmExecVer = oFSO.GetFileVersion(sCcmExecPath)
If sCcmExecVer < sClientVer then install
If sCcmExecVer = sClientVer then ccmstartcheck
Else
install
End If
sub install
sinstall = "
file://bcfdlsccmp01.brunswick.com/SCCM_Client_Install/ccmsetup.exe"
whsShell.LogEvent 1, "sinstall: " & sinstall & " was initiated on " & now & "."
' wscript.echo sinstall
' wscript.Quit
title = "SCCM Installer Utility"
msg = "Installing/Upgrading SCCM Client."
WshShell.Popup msg,5, title, 64
WshShell.Run sInstall, 1, True
End Sub
Sub ccmstartcheck
Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
If err.number <> 0 Then
Exit sub
End If
strMode = ""
Set objList = objWMI.ExecQuery("Select StartMode from Win32_Service where Name=""CcmExec""")
For Each objItem In objList
strMode = objItem.StartMode
Exit For
Next
If strMode = "Auto" Then
ClientInstalledAndAuto = True
Else
ClientInstalledAndAuto = False
If Len(strMode) = 0 Then
WshShell.LogEvent 0, "SMS Advanced Client service not found."
Install
Else
WshShell.LogEvent 0, "SMS Advanced Client service (CCMEXEC) is set to " & strMode
End If
End If
End sub 'ccmstartcheck