Inst_Patches
Kleines Script zum automatisierten Installieren von Patches und Hotfixes innerhalb der Installationsroutine von Office 2003
Nach vorher definierten Dateiendungen werden die unterschiedlichen Installationsroutinen gestartet.
Mit einer kleinen Pfadanpassung auch als Standalone-Loesung für laufende Patch-Installationen ueber SCCM
Verzeichnispfad (Pfad zur VBS-Datei und den im gleichen Ordner liegenden MSPs) muss als Parameter angegeben werden.
option explicit'on error resume nextdim fso, wshell, oargs, activedir, activefile, fc, installtype, i, file, rcdim parent, root, updatesfolder, logpfaddim strcomputer, objWMIService, colProcesses, objProcessDim sngProcessTime, tmplogset wshell = wscript.createobject("Wscript.shell")set fso = wscript.createobject ("Scripting.FileSystemObject")set oArgs=wscript.Argumentsif oArgs.Count 1 then   wscript.echo VBCRLF & "! FEHLER !" & VBCRLF & "! Fehlender oder falscher Parameter !"   wscript.quitEnd ifset activedir = FSO.GetFolder(oargs(0))activedir = activedir&"\Install\Updates"set activedir = FSO.GetFolder(activedir)set fc = activedir.filesinstalltype = array("msp","exe")logpfad = "c:\logs\msi\"for i =LBOUND(installtype) to UBOUND(installtype)install installtype(i)nextsub install(typ)set tmplog = fso.CreateTextFile("c:\testdatei.txt", True)strComputer = "."Set objWMIService = GetObject("winmgmts:" _    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")    for each file in fc    if lcase(fso.GetExtensionName(file.name) = "msp") then    tmplog.writeline ("Installing " & file.name)       rc = wshell.run("C:\WINDOWS\System32\msiexec.exe /p" & " " & activedir & "\" & file.name & " /q /L*v " & logpfad&file.name&".log",0,true)    'elseif lcase(fso.GetExtensionName(file.name) = "exe") then      'rc = wshell.run(activedir & "\" & file.name & " /q",0,true)    end if    Do    tmplog.writeline ("Waiting for msiexec... <=="&  file.name)      Set colProcesses = objWMIService.ExecQuery _                 ("Select * from Win32_process where name =" & "'" & "msiexec.exe" & "'")      wscript.sleep 5000      loop until colprocesses.count=1nexttmplog.closeend sub