October 12, 200520 yr 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...
October 12, 200520 yr 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
October 12, 200520 yr 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 OFFSETLOCALECHO SET objFSO = CreateObject("Scripting.FileSystemObject") >_temp.vbsECHO Wscript.stdout.write objFSO.GetFileVersion("%SystemRoot%\system32\wuapi.dll") >>_temp.vbsFOR /F %%a IN ('CSCRIPT /NOLOGO _temp.vbs') DO IF "%%a" NEQ "5.8.0.2469" START WUv6.exe /wuforce /quiet /norestartDEL _temp.vbsENDLOCALGOTO :EOF
October 12, 200520 yr why do all those time consuming things???go to windows update site and you see if its installed or not
October 13, 200520 yr 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"
October 13, 200520 yr What aboutIF NOT EXIST %SystemRoot%\system32\LegitCheckControl.DLL WUv6.exe /wuforce /quiet /norestart
October 13, 200520 yr Author I'm not sure of that file is part of the windows update V6.If it is, it would work too I guess.Thx for the tips guys.
October 13, 200520 yr @ scphave you ever wondered why some people are just 'too clever' to see something right under their own nose! 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 usedir/-c "%windir%\notepad.exe"|find "69120 bytes">nul||echo/incorrect version
October 16, 200520 yr Author found it somewhere on this forum. But I'm not able to find it back now :-)
October 16, 200520 yr Hmmm ****.. anyone else?Really want to be able to have windows update "updated" upon first load...
Create an account or sign in to comment