Application Detection Method – Check for File or Registry Entry

Use this VB script to check for the existence of a specific file or registry entry. ON ERROR RESUME NEXT file=”c:\Program Files (x86)\Microsoft Office\Office15\Outlook.exe” Set fso = CreateObject(“Scripting.FileSystemObject”) If (fso.FileExists(file)) Then ‘file exists Else ‘file does not exist ‘check for uninstall registry key Set WSHShell = CreateObject(“WScript.Shell”) str_key = “HKLM\Software\Unilever\Packages\Uninstall\OFFICE02013\OFFICE02013-Office2013-Uninstall” str_value = WshShell.RegRead(str_key) if str_value = “Uninstalled” then ‘uninstall reg key exists – uninstall ran else ‘uninstall reg key doesnt exist – uninstall hasnt run wscript.echo “Success” end if End if

Read More

VB Script : Repair SCCM Client Remotely

My VB is not great and I think this script was borrowed from somebody who knows what they were doing.  The link is below. ‘Repair SCCM Client ‘———————————————————— Option Explicit On Error Resume Next Dim sComputer, sSCCMClient If WScript.Arguments.Count = 0 Then sComputer = InputBox(“Enter computer name to repair”) Else sComputer = WScript.Arguments(0) End If Set sSCCMClient = GetObject(“winmgmts://” & sComputer & “/Root/Ccm:SMS_Client”) If Err <> 0 Then MsgBox “Error:” & “(” & Err.Number & “)” & vbCrLf & Err.Description Else sSCCMClient.RepairClient MsgBox (“Repair started for ” & UCase(sComputer)) End…

Read More