Jump to content

Recommended Posts

Posted

Hi,

I use a bat script to install all windows updates. It also includes windows update V6. But I can't find out a way to see if this is already on the system.

I coud use IF NOT EXIST c:\?????? WUv6.exe /wuforce /quiet /norestart

or

REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\????" > nul 2>&1

IF %ERRORLEVEL% EQU 0 (

WUv6.exe /wuforce /quiet /norestart

Just need to find out what the ?????? must be...


Posted
Hi,

I use a bat script to install all windows updates. It also includes windows update V6. But I can't find out a way to see if this is already on the system.

I coud use IF NOT EXIST c:\?????? WUv6.exe /wuforce /quiet /norestart

or

REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\????" > nul 2>&1

IF %ERRORLEVEL% EQU 0 (

WUv6.exe /wuforce /quiet /norestart

Just need to find out what the ?????? must be...

just go to windows update site :whistle:

Posted

Why not just check the file version of one of its installed components.

From WU5 the file version is usually something like 5.4.3790.2182 or whereas in WU6 the file version is 5.8.0.2469. As the new version is known, test for it, and run the install if unsuccessful.

In order to check a file version the easiest method would be to use vbscript. If we wrap it in a cmd and run it, it should work fine.

:: IfOldVer.cmd - Yzöwl ©2005
:: Runs a command upon incorrect file version
::
@ECHO OFF
SETLOCAL
ECHO SET objFSO = CreateObject("Scripting.FileSystemObject") >_temp.vbs
ECHO Wscript.stdout.write objFSO.GetFileVersion("%SystemRoot%\system32\wuapi.dll") >>_temp.vbs
FOR /F %%a IN ('CSCRIPT /NOLOGO _temp.vbs') DO IF "%%a" NEQ "5.8.0.2469" START WUv6.exe /wuforce /quiet /norestart
DEL _temp.vbs
ENDLOCAL
GOTO :EOF

Posted

why do all those time consuming things???:no:

go to windows update site and you see if its installed or not :wacko:

Posted

Another option if u must use batch file, you can check for the file size or the date stamp. Below is the example for Notepad.exe which has file size of 69,120 bytes.

dir %windir%\notepad.exe|find "69,120"
if errorlevel 0 if not errorlevel 1 echo "Version is correct"

Posted

What about

IF NOT EXIST %SystemRoot%\system32\LegitCheckControl.DLL WUv6.exe /wuforce /quiet /norestart

Posted

@ scp

have you ever wondered why some people are just 'too clever' to see something right under their own nose! :blushing:

Another option if u must use batch file, you can check for the file size or the date stamp. Below is the example for Notepad.exe which has file size of 69,120 bytes.
dir %windir%\notepad.exe|find "69,120"
if errorlevel 0 if not errorlevel 1 echo "Version is correct"

This is what I would use
dir/-c "%windir%\notepad.exe"|find "69120 bytes">nul||echo/incorrect version

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...