Hi, thanks for any help in advance..
My goal is to parse the value "ProductID" from "HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion" to obtain the Microsoft Product Code (represented by x in the following example:xxxxx-yyy-zzzzzzz-zzzzz). I have been working on a batch file to work with errorlevels to verify the actual version of the target OS then perform a goto.
VER | FIND "5.1" > nul
IF %ERRORLEVEL% == 0 GOTO ver_xp
I have been using the above which is working, but want to modify it to see the pull that MPC to get a bit more version specific (XP home vs pro vs mediacenter)
I have seen the likes of this next statement around and have modified it a bit...but I am having a bit of trouble with its application as it relates to my goal:
@ECHO OFF
FOR /F "tokens=2*" %%a in ('REG QUERY HKLM\SOFTWARE\Microsoft\"Windows NT"\CurrentVersion |FINDSTR 89587') DO IF %ERRORLEVEL% == 0
GOTO ver_xp
Can anyone help ? I know I am missing something in the above syntax.. its late and ive been stuck for hours..
Thanks again!
Bookmarks