Discussion Locked

MS Security Patch using Scripts

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are needing to quickly deploy a Microsoft Security hotfix to our NT users without having to go from one machine to another. I want to attach a batch file to our login scripts using qchain.exe but how do I keep the system from reinstalling the patch if its already installed? Also, I do not want user interaction so how can I automate answers the the install questions? I have located the following batch script, how would I modify it for these needs?

@echo off
setlocal
set pathoffixes= d:\

%pathoffixes%\MS00-077\q299796_w2k_sp3_x86_en.ex e -z -m
%pathoffixes%\MS00-079\q276471_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-007\q285851_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-013\Q285156EventViewer_W2k.exe -z -m
%pathoffixes%\MS01-022\rbupdate.exe -z -m
%pathoffixes%\MS01-025\q296185_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-031\q299553_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-037\q302755_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-041\q298012_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\MS01-046\q252795_w2k_sp3_x86_en.exe -z -m
%pathoffixes%\qchain.exe

3 replies

by abarnes70

You can use qfecheck.exe from Microsoft to test for the existence of patches; use qfecheck in conjunction with the find command to test and then apply if necessary. For example:

set 832980=0
set 252795=0
.
.
.
%srcFiles%\qfecheck | find /i "823980"
if errorlevel 1 set 823980=1
%srcFiles%\qfecheck | find /i "252795"
if errorlevel 1 set 252795=1
.
.
.
if %823980%==1 %pathoffixes%\.....
if %252795%==1 %pathoffixes%\.....

and so on. You will need to look at the syntax of qfecheck, and of the fixes themselves, to determine which switches to use. For example, most of these hotfixes allow you to use /qn, which shows no user interface. Also make sure that the string you're testing for using the find command is the same as the output from qfecheck.

HTH

This discussion is closed to new replies.