Re: Service Pack Install Script



Pete wrote:

Hi,

Hopefully someone here can help me with this. I'm using a script to deploy windows 2000 sp4 to a number of computers on an nt4 domain by copying install.cmd to C:\ on each computer and running it using the code below.

I want to get the return value from the install procedure (ie 3010 to indicate reboot required) but the code below returns the installreturn value as soon as the process starts. Is there a way of getting the return value of the installation rather than of the install.cmd?

Set process = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strcomputer & "\root\cimv2:Win32_Process")
installreturn = process.Create("c:\install.cmd",Null,Null,processid)
Set objScriptExec = oShell.Exec("net helpmsg " & installreturn)
installresult = objScriptExec.StdOut.ReadAll
strresult = MsgBox(installresult, vbOK, "Installation on: " & ucase(strcomputer))


Hi,

Here is one way of getting back the result:


Change install.cmd to be like this:

--------------------8<----------------------
@echo off
setlocal

set statusfile=c:\spstatus.txt

del "%statusfile%"
:: start install of SP4, wait for it to finish
start /wait sp4.exe /quiet /norestart or something
echo %errorlevel% >"%statusfile%"

--------------------8<----------------------


After your VBScript have launched install.cmd, go unto a loop waiting for the spstatus.txt file to show up on the remote computer (use the admin share and WSH's FileSystemObject to do this).

When spstatus.txt shows up, you know the SP4 installation is finished,
and you can use the admin share and WSH's FileSystemObject to read
the content of the file to see what return code the SP4 installation
returned.




-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx .



Relevant Pages

  • Re: Cant install service pack3.
    ... end up not installing any service pack ever;-) ... For most computers, a SP install will go well, but of course, some ... We have installed SP4 on thousands of computers, ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.win2000.general)
  • Re: W2K SP4 Hosed our PC - Need Help !!!
    ... end up not installing any service pack ever;-) ... For most computers, a SP install will go well, but of course, some ... We have installed SP4 on thousands of computers, ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.win2000.general)
  • Re: New MS Baseline Security Analyzer 2.0
    ... > For stand alone computers not using update services like SUS, MU, ... > believe I should have to pay for checking for Microsoft updates. ... Update version or a WSUS server or a MBSA installation that have ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.security_admin)
  • Re: W2k SP4 & Citrix
    ... There are several known issues between MetaFrame XP and W2K SP4. ... > I have a Citrix farm (4 computers) running Metaframe Xp ... > option as I ran the installation). ...
    (microsoft.public.win2000.security)
  • Re: Win2k sp4
    ... > Will I have to reinstall those updates after installation of SP4? ... you do not need to reapply those two updates... ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.win2000.general)

Loading