GPO Script to install BBCA Agent

Version 1
    Share This:

    Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

    Set objShell = CreateObject("WScript.Shell")
    strCommand = "sc query BBCAClient"
    Set objExecObject = objShell.Exec(strCommand)
    strText = objExecObject.StdOut.ReadAll()

     

    'WScript.Echo strText

     

    If Instr(strText, "RUNNING") > 0 Then
    'WScript.Echo "Tuner is Running"

     

    ElseIf Instr(strText, "STOPPED") > 0 Then
    'WScript.Echo "Tuner is Stopped"

    objShell.run "sc start BBCAClient"


    Else
    'WScript.Echo "Installing Tuner..."
    strSourceFile = "C:\BBCAClientv5_stub.exe"
    strTargetFile = "C:\Temp"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    booOverWrite = vbTrue
    objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite

     

    Do

    If objFSO.FileExists("C:\BBCAClientv5_stub.exe") Then

    Exit Do

    Else

    WScript.Sleep 1000

    End If

    Loop

     

    'WScript.Echo "Installing Tuner..."
    objShell.run "C:\temp\BBCAClientv5_stub.exe"

     

    End If