Some batch files for applying MS03-026
From: Ray (res0cu5i_at_verizon@net)
Date: 08/01/03
- Next message: Shawn: "W2K not prompting for credentials"
- Previous message: Amit Rahul [MS]: "Re: Windows 2000 access violation error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 1 Aug 2003 12:13:40 -0400
Don't shoot me for a cross-post.
Here's a few scripts I wrote for deploying the MS03-026 patch, just in
case some systems might have been missed. The first batch file
(MS03-026_Win2k_Query.bat) uses a FOR loop to run a through a list of
servers (or IP Addresses) using the Resource Kit utility - SrvInfo.exe and
find all the Win2k systems. It then uses the SrvInfo.exe utility to create
a list of all the SP2 systems, then SP3 & SP 4 systems. The secondary batch
files (MS03-026_sp#_Query-Install.bat) are called to check if the patch has
already been applied; if not, another file (for service pack version) is
generated. The psexec.exe utlity (SysInternals) is used to copy & install
(unattended & no reboot) the patch to the remote system. We might have a
few desktop that are unpatched, so we weren't forcing a reboot. There is a
line that is REM'd out that will force a reboot via the SysInternals
utility - psshutdown.exe. The time is set at 900 seconds (15 minutes).
This was chosen so a message could be displayed with a phone number so it
could be requested the shutdown be aborted. Some of this same code (OS, sp
level & is hot fix already applied) can be adopted into a logon script.
There must be a "ToBeScanned.txt" file in the same folder as these batch
files, this is the list of systems or IP Addresses to be scanned. You will
also need Srvinfo.exe (Win2k ResKit), psshutdown.exe & psexec.exe
(www.sysinternals.com), the patch from MS and a "y.txt". The "y.txt" is
just a one-line text file that has a "y" on the first line, and a carriage
return. I"ve separated them out, so you can copy, paste & save as:
MS03-026_Win2k_Query.bat
MS03-026_Win2k_sp2_Query-Install.bat
MS03-026_Win2k_sp3_Query-Install.bat
MS03-026_Win2k_sp4_Query-Install.bat
Hopefully this will help patch your systems.
Disclaimers: I'm not a programmer or heavy batch writer. Use these as
you own risk. I assume no responsibility for these files. MS supports
patching the current service pack & one level down. Apply this patch to
Win2k sp2 systems at your own risk.
(MS03-026_Win2k_Query.bat)
@Echo Off
REM
****************************************************************************
********
REM * Script Name: Windows 2000 MS03-026 patch query
REM * Author:
REM * Date Created: 8-1-03
REM * Notes:
REM * Supporting Files: Srvinfo.exe, ToBeScanned.txt
REM
****************************************************************************
********
REM Initialize the scripting environment
CLS
PROMPT $G
COLOR F1
TITLE Querying computer list for Windows 2000 systems and Service Pack
version
REM PATH %Path%;
SetLocal
REM
REM
****************************************************************************
********
REM Check for file containing the list of computers to be scanned.
REM
If Not Exist ToBeScanned.txt Goto ToBeScanned-is-Missing
REM
REM ****************************************************************
REM
REM Querying list of systems for Win2k systems
REM
Echo.
Echo Querying the supplied list for Win2k systems.
REM
If Exist Win2k.txt Del Win2k.txt < y.txt
@For /f %%q in (ToBeScanned.txt) do SrvInfo \\%%q | find "Product Name:
Microsoft Windows 2000" && Echo %%q >> Win2k.txt
REM
REM ****************************************************************
REM Query Win2k list for Service Pack 2 systems
REM
Echo.
Echo Querying Win2k systems for Service Pack2
REM
If Exist Win2k_sp2.txt Del Win2k_sp2.txt < y.txt
@For /f %%q in (Win2k.txt) do SrvInfo \\%%q | find "Build: 2195, Service
Pack 2" && Echo %%q >> Win2k_sp2.txt
REM
Start MS03-026_sp2_Query-Install.bat
REM
REM ****************************************************************
REM Query Win2k list for Service Pack 3 systems
REM
Echo.
Echo Querying Win2k systems for Service Pack 3
REM
If Exist Win2k_sp3.txt Del Win2k_sp3.txt < y.txt
@For /f %%q in (Win2k.txt) do SrvInfo \\%%q | find "Build: 2195, Service
Pack 3" && Echo %%q >> Win2k_sp3.txt
REM
Start MS03-026_sp3_Query-Install.bat
REM
REM ****************************************************************
REM Query Win2k list for Service Pack 4 systems
REM
Echo.
Echo Querying Win2k systems for Service Pack 4
REM
If Exist Win2k_sp4.txt Del Win2k_sp4.txt < y.txt
@For /f %%q in (Win2k.txt) do SrvInfo \\%%q | find "Build: 2195, Service
Pack 4" && Echo %%q >> Win2k_sp4.txt
REM
Start MS03-026_sp4_Query-Install.bat
REM
Goto EOF
REM
REM ****************************************************************
:ToBeScanned-is-Missing
CLS
Echo.
Echo The file containing the list of systems to be querried is missing.
Echo.
Echo Please check the current directory for the following file -
ToBeScanned.txt
Echo.
Goto EOF
REM ****************************************************************
:EOF
Pause
(MS03-026_Win2k_sp2_Query-Install.bat)
@Echo Off
REM
****************************************************************************
********
REM * Script Name: MS03-026 SP2 hot-fix query and install
REM * Author:
REM * Date Created: 8-1-03
REM * Notes:
REM * Supporting Files: Srvinfo.exe, PSExec.exe, MS03-026 hot-fix
(KB823980), PSShutdown
REM
****************************************************************************
********
REM Initialize the scripting environment
CLS
PROMPT $G
COLOR F1
TITLE MS03-026 Service Pack 2 hot-fix query and installation.
REM PATH %Path%;
SetLocal
REM
REM
****************************************************************************
********
REM Find unpatched Win2k Service Pack 2 systems
REM
Echo.
Echo Querying the list of Win2k sp2 systems for the presence of MS03-026
REM
If Exist Win2k_sp2_Unpatched.txt Del Win2k_sp2_Unpatched.txt < y.txt
@For /f %%q in (Win2k_sp2.txt) do SrvInfo.exe \\%%q | find "[KB823980]:" ||
Echo %%q >> Win2k_sp2_Unpatched.txt
REM
REM ****************************************************************
REM Deploy patch to unpatched Win2k Service Pack 2 systems
REM
Echo.
Echo Deploying MS03-026 (KB823980) to the unpatched Win2k sp2 systems.
REM
@If Exist Win2k_sp2_Unpatched.txt For /f %%q in (Win2k_sp2_Unpatched.txt) do
PSExec.exe \\%%q -c Windows2000-KB823980-x86-ENU.exe -u -q -z
REM
REM ****************************************************************
REM Force reboot of patched systems to complete patch installation
REM
REM Echo.
REM Echo The patched systems will be rebooted.
REM
REM @For /f %%q in (Win2k_sp2_Unpatched.txt) do PSShutdown.exe -t 900 -m "
" -f -r \\%%q
REM
REM ****************************************************************
REM
Echo.
Echo The Win2k sp2 systems have had the MS03-026 patch applied.
Echo.
Echo Please reboot these systems (see Win2k_sp2_Unpatched.txt) to complete
the patch installation.
REM
REM Echo The Win2k sp2 systems have had the MS03-026 patch applied and
rebooted.
Echo.
Pause
(MS03-026_Win2k_sp3_Query-Install.bat)
@Echo Off
REM
****************************************************************************
********
REM * Script Name: MS03-026 SP3 hot-fix query and install
REM * Author:
REM * Date Created: 8-1-03
REM * Notes:
REM * Supporting Files: Srvinfo.exe, PSExec.exe, MS03-026 hot-fix
(KB823980), PSShutdown
REM
****************************************************************************
********
REM Initialize the scripting environment
CLS
PROMPT $G
COLOR F1
TITLE MS03-026 Service Pack 3 hot-fix query and installation.
REM PATH %Path%;
SetLocal
REM
REM
****************************************************************************
********
REM Find unpatched Win2k Service Pack 3 systems
REM
Echo.
Echo Querying the list of Win2k sp3 systems for the presence of MS03-026
REM
If Exist Win2k_sp3_Unpatched.txt Del Win2k_sp3_Unpatched.txt < y.txt
@For /f %%q in (Win2k_sp3.txt) do SrvInfo.exe \\%%q | find "[KB823980]:" ||
Echo %%q >> Win2k_sp3_Unpatched.txt
REM
REM ****************************************************************
REM Deploy patch to unpatched Win2k Service Pack 3 systems
REM
Echo.
Echo Deploying MS03-026 (KB823980) to the unpatched Win2k sp2 systems.
REM
@If Exist Win2k_sp3_Unpatched.txt For /f %%q in (Win2k_sp3_Unpatched.txt) do
PSExec.exe \\%%q -c Windows2000-KB823980-x86-ENU.exe -u -q -z
REM
REM ****************************************************************
REM Force reboot of patched systems to complete patch installation
REM
REM Echo.
REM Echo The patched systems will be rebooted.
REM
REM @For /f %%q in (Win2k_sp3_Unpatched.txt) do PSShutdown.exe -t 900 -m "
" -f -r \\%%q
REM
REM ****************************************************************
REM
Echo.
Echo The Win2k sp3 systems have had the MS03-026 patch applied.
Echo.
Echo Please reboot these systems (see Win2k_sp3_Unpatched.txt) to complete
the patch installation.
REM
REM Echo The Win2k sp3 systems have had the MS03-026 patch applied and
rebooted.
Echo.
Pause
(MS03-026_Win2k_sp4_Query-Install.bat)
@Echo Off
REM
****************************************************************************
********
REM * Script Name: MS03-026 SP4 hot-fix query and install
REM * Author:
REM * Date Created: 8-1-03
REM * Notes:
REM * Supporting Files: Srvinfo.exe, PSExec.exe, MS03-026 hot-fix
(KB823980), PSShutdown
REM
****************************************************************************
********
REM Initialize the scripting environment
CLS
PROMPT $G
COLOR F1
TITLE MS03-026 Service Pack 4 hot-fix query and installation.
REM PATH %Path%;
SetLocal
REM
REM
****************************************************************************
********
REM Find unpatched Win2k Service Pack 4 systems
REM
Echo.
Echo Querying the list of Win2k sp4 systems for the presence of MS03-026
REM
If Exist Win2k_sp4_Unpatched.txt Del Win2k_sp4_Unpatched.txt < y.txt
@For /f %%q in (Win2k_sp4.txt) do SrvInfo.exe \\%%q | find "[KB823980]:" ||
Echo %%q >> Win2k_sp4_Unpatched.txt
REM
REM ****************************************************************
REM Deploy patch to unpatched Win2k Service Pack 4 systems
REM
Echo.
Echo Deploying MS03-026 (KB823980) to the unpatched Win2k sp2 systems.
REM
@If Exist Win2k_sp4_Unpatched.txt For /f %%q in (Win2k_sp4_Unpatched.txt) do
PSExec.exe \\%%q -c Windows2000-KB823980-x86-ENU.exe -u -q -z
REM
REM ****************************************************************
REM Force reboot of patched systems to complete patch installation
REM
REM Echo.
REM Echo The patched systems will be rebooted.
REM
REM @For /f %%q in (Win2k_sp4_Unpatched.txt) do PSShutdown.exe -t 900 -m "
" -f -r \\%%q
REM
REM ****************************************************************
REM
Echo.
Echo The Win2k sp4 systems have had the MS03-026 patch applied.
Echo.
Echo Please reboot these systems (see Win2k_sp4_Unpatched.txt) to complete
the patch installation.
REM
REM Echo The Win2k sp2 systems have had the MS03-026 patch applied and
rebooted.
Echo.
Pause
- Next message: Shawn: "W2K not prompting for credentials"
- Previous message: Amit Rahul [MS]: "Re: Windows 2000 access violation error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|