Script to Install Windows XP updates Hangs

Welcome Forums General PowerShell Q&A Script to Install Windows XP updates Hangs

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
2 years, 2 months ago.

  • Author
    Posts
  • #59457

    Participant
    Points: 0
    Rank: Member

    Hi,

    Environment: Server 2008 or Server 2012 (Script to be run from)
    Client PC's: Windows XP PC's with PS Remoting enabled and connectivity verified.

    I am trying to develop a process which will look for any update.exe files stored in a particular folder on the PC and install them on the local XP PC.

    I have developed the install script and when I run this on the target PC while logged in interactively it seems to find the setup files and install them. The trouble I am having is when I try to use the Invoke-Command method to run the install script from a server. The reason I am trying to do it this way is to schedule the installs on multiple PC's. When the script is run I can see it trying to install the setup.exe file but it just hangs and doesn't complete the install or move on to the next one. I am not sure what might be causing this and any help would be greatly appreciated.

    I thought it might be the install switches but when I tries /quiet it still has the same issue.

    I have copied the install code below:

    foreach ($CustomXPUpdate in $CustomXPUpdates)
    {
    Write-Log " "

    $InstallUpdate = $LocalHotfixPath + $CurrentYear + ("\") + $CurrentMonth + ("\") + $CustomXPUpdate

    $KBName = $CustomXPUpdate -replace "WindowsXP-", "" -replace "IE8-WindowsXP-","" -replace "-x86-Custom-ENU.exe", ""

    Write-Log " "
    Write-Log "Current Update installation path is: $InstallUpdate"
    Write-Log "Current update in pipleine $CustomXPUpdate"
    Write-Log "Checking to see if $KBName is installed on $($env:COMPUTERNAME)"
    Write-Log " "
    if (!(get-hotfix -id $KBName)) {

    Write-Log " $KBName is not Installed"
    Write-Log "Installing $CustomXPUpdate ..."
    Write-Log " "

    Start-Process -FilePath "$InstallUpdate" -ArgumentList /passive" /Norestart" -Wait

    if (!(get-hotfix -id $KBName)) {

    Write-Log " $CustomXPUpdate did not Install correctly, Please Investigate"
    Write-Log " "
    Write-Log " "

    }
    else
    {
    Write-Log " [SUCCESS] $CustomXPUpdate has been installed on $($env:COMPUTERNAME) "
    Write-Log " "
    Write-Log " "
    }

  • #59476

    Participant
    Points: 21
    Rank: Member

    Could you format your codeblock? It would be much easier to read.

  • #59532

    Participant
    Points: 0
    Rank: Member

    Hi Hermann,

    thanks for interest, I am very new to PowerShell so apologise in advance for the poor scripting...
    the write-log is a function defined earlier in the script. Is there a way to see what the setup.exe is waiting for? My log file records events but only the ones I specify with the "write-Log" function.

    
    foreach ($CustomXPUpdate in $CustomXPUpdates)
    {
         Write-Log " "
         $InstallUpdate = $LocalHotfixPath + $CurrentYear + ("\") + $CurrentMonth + ("\") + $CustomXPUpdate
         $KBName = $CustomXPUpdate -replace "WindowsXP-", "" -replace "IE8-WindowsXP-","" -replace "-x86-Custom-ENU.exe", ""
         Write-Log " "
         Write-Log "Current Update installation path is: $InstallUpdate"
         Write-Log "Current update in pipleine $CustomXPUpdate"
         Write-Log "Checking to see if $KBName is installed on $($env:COMPUTERNAME)"
         Write-Log " "
     
      if (!(get-hotfix -id $KBName))
         {
           Write-Log " $KBName is not Installed"
           Write-Log "Installing $CustomXPUpdate ..."
          Write-Log " "
          Start-Process -FilePath "$InstallUpdate" -ArgumentList /passive" /Norestart" -Wait
                if (!(get-hotfix -id $KBName)) 
                   {
                   Write-Log " $CustomXPUpdate did not Install correctly, Please Investigate"
                   Write-Log " "
                   Write-Log " "
                   }
      else
                  {
                   Write-Log " [SUCCESS] $CustomXPUpdate has been installed on $($env:COMPUTERNAME) "
                   Write-Log " "
                   Write-Log " "
                   }
    
    
  • #59592

    Participant
    Points: 0
    Rank: Member

    some updates want to accept license....

The topic ‘Script to Install Windows XP updates Hangs’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort