Jump to content

Help with a batch file


Blyenth

Recommended Posts

I am trying to write a batch file that will call up "hklm\software\microsoft\windows nt\currentversion\csdversion" and determine if Service Pack 2 is installed. If SP2 isn't installed, have it install it for me. Any help would be awesome thank you.

Blyenth

Link to comment
Share on other sites


@ECHO OFF

FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\software\Microsoft\windows nt\currentversion" /v csdversion') DO SET spver=%%B

ECHO Service Pack Version = %spver%

if not "%spver%" == "Service Pack 2" (

echo install service pack 2

rem **insert path and sp2 location here**

)

if "%spver%" == "Service Pack 2" (

echo Service Pack 2 is installed

)

pause

Link to comment
Share on other sites

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...