Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Service Pack 3 Install Issue

Status
Not open for further replies.
Mar 8, 2004
89
0
0
CA
Hi All,

I have a few legacy machines still wiht XP SP2 on them and am trying to script a logoff script to read the reg value of HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion for the value of "Service Pack 2" and if so to run the SP3 installer silently. but for the life of me the I can not seem to get the script to run without exiting after checking the regvalue.

what am I missing here

REM @echo off
find | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion"
if "Service Pack 2" goto Install
if other goto End

:Install
echo Installing Service Pack 3
\\<servername>\<Sharename>\WINXPSP3.msi /quiet /norestart

:end
 
Try sticking a pause after each line. That way you can see whats happening

Robert Wilensky:
We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true.

 
Maybe you can base code off the following example?

Code:
@echo off
echo.

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion | find "Service Pack 2"

if errorlevel 2 goto Error
if errorlevel 1 goto NotFound

echo Search text found
goto End

:Notfound
echo Search text not found
goto End

:Error
echo Error occurred while executing Find command

:End
echo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top