Linux-Noob Forums
Install Hotfixes Via Batch Files - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Windows Noob (https://www.linux-noob.com/forums/forum-5.html)
+--- Forum: Tips and Tricks (https://www.linux-noob.com/forums/forum-73.html)
+--- Thread: Install Hotfixes Via Batch Files (/thread-3876.html)



Install Hotfixes Via Batch Files - Digerati - 2003-12-18


I wanted a simple way for me to install hotfixes with a script.

 

Some allow autoupdates to take care of this task but to me hotfixes are sometimes hotcrashes and if I am the one installed only the hotfixes I want then if they install bad I will know exactly what & why.

 

There is a utility from M$ called SUS that will download all patches and you

can tell it what to install on the clients and when.

 

It likes a lot of space though and the server I wanted to install it on

would not hold it so I had to craft another idea.

 

First idea was a logon script but login scripts run in the USERS context and

sometimes depending on what you put in the script requires certain

permissions.

 

I also only want this to run for a short while so I decided to use GPO and I

will disable the policy later.

 

I made a batch file and used group policy to to add it to computer

configuration / windows settings / startup scripts.

 

This site helped:

[/url][url=http://www.2000trainers.com/article.asp]http://www.2000trainers.com/article.asp ... 198&page=1

 

[start of file]

@ECHO OFF

VER|FIND "XP">NUL

IF NOT ERRORLEVEL 1 GOTO WinXP

VER|FIND "2000">NUL

IF NOT ERRORLEVEL 1 GOTO Win2K

GOTO BADOS

 

 

:WinXP

ECHO WinXP

GOTO END

 

:Win2K

ECHO Win2K

if exist "c:\winnt\$NtUninstallKB824146$" GOTO END

START notepad \\server\netlogon\info.txt

 

"\\server\apps\Security Patches Win2k\Windows2000-KB824146-x86-ENU.exe"

/u

/q

 

 

:BADOS

ECHO This OS is not supported

GOTO END

 

:END

[end of file]

 

INFO.TXT says:

::::Message::::::::

 

Your computer is installing the latest Microsoft Hotfix and will reboot

when

finished.