Announcement

Collapse
No announcement yet.

Problem Deploying WinXP Hotfix 889320

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem Deploying WinXP Hotfix 889320

    I have been trying and failing to deploy WinXP Hotfix 889320. This is a hotfix you have to request from MS, so I don't think WSUS would work, not that I can use WSUS anyway (long story).

    The file is copied to the client via a CMD and executes OK and but appears to be unable to unload after finishing execution. As a result, the PC is stuck on the "Running startup scripts" window, until the script times out after 10 minutes. The VBS scriptfails to create a check file that prevents the script from running a second time.

    After the PC finishes booting the hotfix appears under the list of installed programs. When the PC reboots the process repeats itself and the machine hangs again while running startup scripts.

    I have tried various combinations of switches (passive, quiet, forcerestart) but none make a difference.

    I ran into a similar problem trying to run the EXE via a CMD script.

    I am trying to run the script via the Startup section of an Active Directory group policy.

    Any help is appreciated. I'm pretty much a newbie so please be gentle!

    Cliff


    Here is the code for the VBS script:

    '************************************************* *********************
    Option Explicit

    Dim oShell : set oShell = WScript.CreateObject("WScript.Shell")
    Dim oFS : set oFS = WScript.CreateObject("Scripting.FileSystemObject")
    Dim checkFileExists : checkFileExists = "C:\BrowserHotfixcheckfile.txt"
    'define environment variable that specifies the command-line processor cmd.exe
    Dim COMSPEC : COMSPEC = oShell.ExpandEnvironmentStrings("%COMSPEC%")

    'comment out the following line to unsuppress error message boxes
    On error resume next
    'wscript.echo "step 0"

    '********************* SETUP FOR WINXP

    if (GetTheOS() = "WXP") then

    ' IF the check file does not exist then run the following steps
    If(NOT oFS.FileExists(checkFileExists)) Then

    'define variable to install the Computer Browser Hotfix KB889320
    Dim installBrowserHF : installBrowserHF = """\\ds2\Network Services\WinXP Computer Browser Hotfix\scripts\WinXP_Hotfix_KB889320_Install.cmd"" "

    'run script to install KB889320
    oShell.Run COMSPEC & " /c " & installBrowserHF , 5, True

    oShell.Run "c:\updates\WindowsXP-KB889320-x86-ENU.exe /passive", 5, True

    writeCheckFile()

    End if

    End if

    ' ******************** END MAIN *************************

    ' Will work with most versions of WSH (windows shell)
    Function GetTheOS()
    CONST FORREADING = 1
    Dim sResults, fFile
    Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
    Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
    Dim sTemp : sTemp = WshShell.ExpandEnvironmentStrings("%TEMP%")
    Dim sTempFile : sTempFile = "c:\runresult.tmp"
    WshShell.Run "%comspec% /c ver >" & sTempFile, 0, True

    Set fFile = FSO.OpenTextFile(sTempFile, FORREADING)
    sResults = fFile.ReadAll
    fFile.Close
    Fso.DeleteFile(sTempFile)

    Select Case True
    Case InStr(sResults, "Windows NT") > 1 : GetTheOS = "NT4"
    Case InStr(sResults, "Windows 2000") > 1 : GetTheOS = "W2K"
    Case InStr(sResults, "Windows XP") > 1 : GetTheOS = "WXP"
    Case Else : GetTheOS = "Unknown"
    End Select
    End Function

    'function for writing the checkfile
    Function writeCheckFile()
    Dim checkFile
    Set checkFile = oFS.CreateTextFile("C:\BrowserHotfixCheckfile.txt" , True)
    checkFile.WriteLine("This file is used by the script BrowserHotfixCheckfile.vbs")
    checkFile.WriteBlankLines(1)
    checkFile.WriteLine("If it is the first time the script runs it will write")
    checkFile.WriteLine("this file to C:\BrowserHotfixCheckfile.txt.")
    checkFile.WriteBlankLines(1)
    checkFile.WriteLine("If this file exists the next time the script will skip")
    checkFile.WriteLine("the running of the Computer Browser hotfix.")
    End Function

    '*********** CLEAN UP *******************

    Set oFS = Nothing
    Set oShell = Nothing

    WScript.Quit (0)

    '********** END CODE ****************

  • #2
    Re: Problem Deploying WinXP Hotfix 889320

    First off all, comment the line: On Error Resume next

    Can you show whats in "WinXP_Hotfix_KB889320_Install.cmd"?
    And can you please wrap all code between [code] script [/code]-tags.


    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Problem Deploying WinXP Hotfix 889320

      I commented out "On Error Resume Next". That does not seem to have changed the behavior of the script.

      I looked in the Event Log while the PC was hung and the System log does include an entry indicating that the Hotfix was successfully installed.
      Event ID 4377: Windows XP Hotfix KB889320 was installed.

      Here is the VBS code again.

      Code:
      '****************** START MAIN ***********************************************
      Option Explicit
      
      Dim oShell :          set oShell = WScript.CreateObject("WScript.Shell")
      Dim oFS :             set oFS = WScript.CreateObject("Scripting.FileSystemObject")
      Dim checkFileExists : checkFileExists = "C:\BrowserHotfixcheckfile.txt"
      'define environment variable that specifies the command-line processor cmd.exe
      Dim COMSPEC : 	      COMSPEC = oShell.ExpandEnvironmentStrings("%COMSPEC%")
      
      'comment out the following line to unsuppress error message boxes
      'On error resume next
      'wscript.echo "step 0"
      
      '************** removing checkfile for code to run ***************************
      
      'uncoment the following three lines when you want to force run the code below
      
         'IF (oFS.FileExists(checkFileExists)) then
         'oFS.deletefile (checkFileExists)
         'end if
      
      '********************* SETUP FOR WINXP ****************************************
      
      if (GetTheOS() = "WXP") then
      
      	' IF the check file does not exist then run the following steps
      	If(NOT oFS.FileExists(checkFileExists)) Then
      
      		'define variable to install the Computer Browser Hotfix KB889320
      		Dim installBrowserHF : installBrowserHF = """\\ds2\Network Services\WinXP Computer Browser Hotfix\scripts\WinXP_Hotfix_KB889320_Install.cmd"""
      
      		'run script to install KB889320
      		oShell.Run COMSPEC & " /c " & installBrowserHF , 5, True
      
      		oShell.Run "c:\updates\WindowsXP-KB889320-x86-ENU.exe /forcerestart /passive", 5, True
      
      		writeCheckFile()
      
      	End if
      
      End if
      
      ' ******************** END MAIN *************************
      
      ' Will work with most versions of WSH (windows shell)
      Function GetTheOS()
          CONST FORREADING = 1
          Dim sResults, fFile
          Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
          Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
          Dim sTemp : sTemp = WshShell.ExpandEnvironmentStrings("%TEMP%")
          Dim sTempFile : sTempFile = "c:\runresult.tmp"
          WshShell.Run "%comspec% /c ver >" & sTempFile, 0, True
      
          Set fFile = FSO.OpenTextFile(sTempFile, FORREADING)
          sResults = fFile.ReadAll
          fFile.Close
          Fso.DeleteFile(sTempFile)
      
          Select Case True
              Case InStr(sResults, "Windows NT") > 1 : GetTheOS = "NT4"
              Case InStr(sResults, "Windows 2000") > 1 : GetTheOS = "W2K"
              Case InStr(sResults, "Windows XP") > 1 : GetTheOS = "WXP"
              Case Else : GetTheOS = "Unknown"
          End Select
      End Function
      
      'function for writing the checkfile
      Function writeCheckFile()
      	Dim checkFile
      	Set checkFile = oFS.CreateTextFile("C:\BrowserHotfixCheckfile.txt", True)
      	checkFile.WriteLine("This file is used by the script BrowserHotfixCheckfile.vbs")
      	checkFile.WriteBlankLines(1)
      	checkFile.WriteLine("If it is the first time the script runs it will write")
      	checkFile.WriteLine("this file to C:\BrowserHotfixCheckfile.txt.")
      	checkFile.WriteBlankLines(1)
      	checkFile.WriteLine("If this file exists the next time the script will skip")
      	checkFile.WriteLine("the running of the Computer Browser hotfix.")
      End Function
      
      '***********  CLEAN UP  *******************
      
      Set oFS = Nothing
      Set oShell = Nothing
      
      WScript.Quit (0)
      
      '**********   END CODE  ****************
      Here is the CMD code. My apologies for omitting this the first time.

      Code:
      echo start Browser Hotfix
      
      net use r: "\\ds2\Network Services\WinXP Computer Browser Hotfix"
      mkdir c:\updates
      xcopy /Y r:\WindowsXP-KB889320-x86-ENU.exe c:\updates
      net use /persistent:no
      net use /delete r:
      
      echo end Browser Hotfix

      Comment


      • #4
        Re: Problem Deploying WinXP Hotfix 889320

        I would not use the *.bat file

        In the vbscript replace the lines:
        Code:
        '********************* SETUP FOR WINXP ****************************************
        
        if (GetTheOS() = "WXP") then
        
        	' IF the check file does not exist then run the following steps
        	If(NOT oFS.FileExists(checkFileExists)) Then
        
        		'define variable to install the Computer Browser Hotfix KB889320
        		Dim installBrowserHF : installBrowserHF = """\\ds2\Network Services\WinXP Computer Browser Hotfix\scripts\WinXP_Hotfix_KB889320_Install.cmd"""
        
        		'run script to install KB889320
        		oShell.Run COMSPEC & " /c " & installBrowserHF , 5, True
        
        		oShell.Run "c:\updates\WindowsXP-KB889320-x86-ENU.exe /forcerestart /passive", 5, True
        
        		writeCheckFile()
        
        	End if
        
        End if
        With
        Code:
        '********************* SETUP FOR WINXP ****************************************
        Dim sSource, sDestination, sFile, strCommand, erReturn
        
        If (GetTheOS() = "WXP") then
          ' IF the check file does not exist then run the following steps
          With oFS
           If(NOT .FileExists(checkFileExists)) Then
             'define variable to install the Computer Browser Hotfix KB889320
             sSource = "\\ds2\Network Services\WinXP Computer Browser Hotfix"
             sDestination = "c:\updates"
             sFile = "WindowsXP-KB889320-x86-ENU.exe"
             If Not .FolderExists(sDestination) Then .CreateFolder sDestination
          End With
             ' copy setup file to local computer
             strCommand = "Xcopy.exe /D /y "
             strCommand = strCommand & chr(34) & sSource & "\" & sFile & chr(34)
             strCommand = strCommand & " " & Chr(34) & sDestination & chr(34)
             erReturn = oShell.Run(strCommand, 0, true)
             ' execute setup file
             strCommand = Chr(34) & sDestination & "\" & sFile & chr(34)
             strCommand = strCommand & " /forcerestart /passive"
             erReturn = oShell.Run(strCommand, 1, true)
             If erReturn = 0 then writeCheckFile()
           End If
        End If
        Try to install the hotfix with a /s OR a /q switch at the command-line


        An other way to check if the hotfix already is installed, could be to search for it in this registry key:
        HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall\<subkey>\DisplayName


        \Rems

        Found these switches:
        KB889320.EXE /q /z /n /o
        (when installing patches, updates or hotfixes, there is a change the script also have to forse a reboot after the installation (?!) )
        Last edited by Rems; 19th October 2007, 00:02.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment


        • #5
          Re: Problem Deploying WinXP Hotfix 889320

          Thanks for your help. I had to tinker a bit with the code you suggested. The script kept insisting that part of an If statement was missing. Also, once I fixed that the WITH oFS part failed for some reason.

          I finally got the script to run but ended up back with the same problem - startup scripts failing to close until they time out after 10 minutes. Then, I had a moment of inspiration. I changed "/forcerestart" to "/norestart". This worked!

          The script runs once and installs but does not write the check file. When I looked inside the PC the hotfix was listed in Add/Remove programs, there was no error log entry, and the new version of browser.dll was waiting to register the next time the PC ran. I rebooted. The hotfix started to run a second time but stopped once it had detected that the update was already installed. The check file did write to the PC the second time. On a third reboot the VBS script did not execute the hotfix, having first found the check file.

          Here's the code I used:

          Code:
          '********************* SETUP FOR WINXP ****************************************
          
          Dim sSource, sDestination, sFile, strCommand, erReturn
          
          If (GetTheOS() = "WXP") then
          
              ' If the check file does not exist then run the following steps
              If(NOT oFS.FileExists(checkFileExists)) Then
            
                  'define variables to install the Computer Browser Hotfix KB889320
                  sSource = "\\ds2\Network Services\WinXP Computer Browser Hotfix"
                  sDestination = "c:\updates"
                  sFile = "WindowsXP-KB889320-x86-ENU.exe"
              
                  'create detination folder if needed
                  If (Not oFS.FolderExists(sDestination)) Then
                      oFS.CreateFolder sDestination
                  End If
              
                  ' copy setup file to local computer
                  strCommand = "Xcopy.exe /D /y "
                  strCommand = strCommand & chr(34) & sSource & "\" & sFile & chr(34)
                  strCommand = strCommand & " " & Chr(34) & sDestination & chr(34)
                  erReturn = oShell.Run(strCommand, 0, true)
                  
                  ' execute setup file
                  strCommand = Chr(34) & sDestination & "\" & sFile & chr(34)
                  strCommand = strCommand & " /norestart /passive"
                  erReturn = oShell.Run(strCommand, 1, true)
                  
                  'if the hotfix runs successfully write the check file
                  If erReturn = 0 then
                        writeCheckFile()
                  End If
              
              End If
          
          End If
          
          ' ******************** END MAIN *************************
          I like it that I got rid of the CMD file that was used to xcopy the file over to the target PC.

          Thanks for your help.

          Cliff

          Comment


          • #6
            Re: Problem Deploying WinXP Hotfix 889320

            Rems

            I've tried to add to your reputation points. My first time so I hope I suceeded.

            Cliff

            Comment


            • #7
              Re: Problem Deploying WinXP Hotfix 889320

              Rems

              I've tried to add to your reputation points. My first time so I hope I succeeded.

              Cliff

              Comment


              • #8
                Re: Problem Deploying WinXP Hotfix 889320

                Originally posted by ccook13 View Post
                Rems

                I've tried to add to your reputation points. My first time so I hope I succeeded.

                Cliff
                Thank you Cliff for the reputation points

                I am glad you sorted it out, and for letting us know.

                I don't have any experience with hotfixes, could it be that the shortname for the "/norestart" switch is "/n"? This is the command-line I found on the internet:
                WindowsXP-KB889320-x86-ENU.exe /q /z /n /o
                All I know is that the /q is for '/Quiet'.

                The checkfile will only be created when the process of the HotFix installation returned errorlevel 0 (succesful) apparently this is not the case after the first run. With an Wscript.echo you can discover the different error levels and maybe there are others errors you can to accept for the creation of the checkfile?
                Instead of using the checkfile you can also query the registrykey for the displayname (or specific key name) of the hotfix. Or.. you can check the properties of the browser.dll (http://www.activexperts.com/activmon...folders/files/).

                You can force a reboot with 'vbs Code' right after the installation.

                \Rems

                This posting is provided "AS IS" with no warranties, and confers no rights.

                __________________

                ** Remember to give credit where credit's due **
                and leave Reputation Points for meaningful posts

                Comment

                Working...
                X