Re: Patch Installation via VBScript

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: rafet (anonymous_at_discussions.microsoft.com)
Date: 03/04/04


Date: Thu, 4 Mar 2004 02:55:42 -0800

Hi !!

Die Installation funktioniert nun tadellos. Ein Problem
existiert aber noch. Bei jeder Anmeldung am System wird
der Patch installiert.
Das Script müsste nun aus der registry auslesen, ob dieser
Patch bereits installiert ist oder nicht. Wenn ja, soll
keine erneute Installation durchgeführt werden. Habe auch
folgendes im Netz gefunden, was ich aber noch in mein
Script einbauen muesste ( Wie gesagt, ich habe von
VBScript keine Ahnung ):

'Path to HotFix
Const FixLoc = "\\MyServer\HOTFIXES\MDAC\Q832483\"
'Registry to store hot fix info
Const KeyPath = "HKLM\Software\NON Windows
Installer\Hotfixes\"
'HotFix ID (key in Reg)
Const KeyVal = "Q832483"
'HotFix MSO Number
Const MSO = "MS04-003"
Const ScriptTools = "\\MyServer\ScriptTools\"
Const ForReading = 1, ForWriting = 2

Dim sCMD
Set wshShell = CreateObject("Wscript.Shell")
Set WshSysEnv = wshShell.Environment("Process")
sLocalName = UCase(WshSysEnv("COMPUTERNAME"))

sCMD = "cmd /c " & FixLoc & "ENU_Q832483_MDAC_X86.EXE /C:"
& chr(34) & "dahotfix.exe /q /n" & Chr(34) & " /q"

If KeyExists (KeyPath & MSO & "\" & KeyVal) = False Then
    wshShell.run sCMD, 7, True
    wshShell.RegWrite KeyPath & MSO & "\" &
KeyVal, "Installed on " & Now & " From: " & FixLoc &
sCmd, "REG_SZ"
End if

' To check if a registry value exists
Public Function KeyExists(key)
    Dim key2
    On Error Resume Next
    key2 = wshShell.RegRead(key)
    If err <> 0 Then
        KeyExists = False
    Else
        KeyExists = True
    End If
End Function

Könnt Ihr mir dabei behilflich sein ?

Gruss

Rafet

>-----Originalnachricht-----
>Hallo Matthias, Hallo Spider81,
>Matthias Lippmann wrote:
>> Hallo "Spider81",
>>
>> "spider81" schrieb
>>
>>>
hotfix "Q832483_MDAC_x86",3,"\\servername\install\software\
>>>
SpsHotfixes\Hotfixes\Q832483_MDAC_X86.EXE /C:"dahotfix.exe
>>> /q /n" /q
> ^^^^^^
>
> [...]
>> Der String für den Pfad ist aber im Aufruf der Sub bei
dem
>> Anführungszeichen zwischen /C: und dahotfix.exe zu Ende.
>> Ersetze das einfach durch ein chr(34):
>>
>> hotfix "Q832483_MDAC_x86", _
>> 3 , "\\servername\install\blabla\X86.EXE /C:" & chr(34)
& _
>> "dahotfix.exe /q /n"
>
>Hier fehlt noch das abschliessende Anführungszeichen um
dahotfix.exe /q/n in
>Anführungszeichen einzuschliessen.
>
>Analog um den zweiten Parameter /q nicht untern Tisch
fallen zu lassen:
>
> hotfix "Q832483_MDAC_x86", _
> 3 , "\\servername\install\blabla\X86.EXE /C:" & chr(34)
& _
> "dahotfix.exe /q /n" & chr(34) & "/q"
>
>MfG
>Thomas
>
>
>.
>



Relevant Pages

  • Re: Ruhezustand-Button & Standbygleichzeitig unter Computer aussch
    ... Setze ich den Wert jedoch bei mir ... > in der Registry nur dann funktionieren, ... Auch die Quelle für das Hotfix ist im Artikel genannt. ... Sorry wegen des Pseudonyms, aber ich seh damit kein Problem! ...
    (microsoft.public.de.german.windowsxp.sonstiges)
  • Re: Rpchttp_setup.vbs
    ... Dim oArg, oRootDSE, oADOconn, oADOcomm, rs, oOutputFile, oFSO ... Const ADS_SCOPE_ONELEVEL = 1 ... Unable to create registry import file '%x'. ... Const L_STATEXSKV_TEXT = "Skipped %x Exchange servers without Windows Server ...
    (microsoft.public.exchange.admin)
  • Re: rpchttp_setup.vbs script
    ... Dim oArg, oRootDSE, oADOconn, oADOcomm, rs, oOutputFile, oFSO ... Const ADS_SCOPE_ONELEVEL = 1 ... Unable to create registry import file '%x'. ... Const L_STATEXSKV_TEXT = "Skipped %x Exchange servers without Windows Server ...
    (microsoft.public.exchange.admin)
  • Re: Article KB834651 TS Licensing mode changes
    ... I have used the hotfix on many different servers without problems ... after you make a change in add/remove programs. ... > took a look at the registry of the TS machine and bingo, ... Then I could wait for the tested service pack. ...
    (microsoft.public.windows.terminal_services)
  • Re: Deleting registry keys
    ... Const HKEY_LOCAL_MACHINE = &H80000002 ... Dim RegHive ... 'Select registry hive constant from above list. ... RegKey 'Recursive sub to delete all subkeys and parent key. ...
    (microsoft.public.scripting.wsh)