robotnik Posted October 27, 2008 Share Posted October 27, 2008 Can anyone tell me whats wrong with this command?reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion"Thanks in advance! Link to comment Share on other sites More sharing options...
nullbyte Posted October 27, 2008 Share Posted October 27, 2008 (edited) Use:reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion Edited October 27, 2008 by nullbyte Link to comment Share on other sites More sharing options...
robotnik Posted October 27, 2008 Author Share Posted October 27, 2008 Thank you! Link to comment Share on other sites More sharing options...
nullbyte Posted October 27, 2008 Share Posted October 27, 2008 Thank you! No problem, /v queries for a specific key, and /s queries all subkeys and values. Link to comment Share on other sites More sharing options...
robotnik Posted October 28, 2008 Author Share Posted October 28, 2008 That's a huge step in the right direction but does anyone know how to save the result of the reg query command to a variable? Ive tried using %1%, %1 and %%i in the following manner:for /f "skip=4 tokens=3" %%? in ('HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion') do set CSDVersion=%%?set CSDVersion=%CSDVersion:~-3%reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion"if %1% == "Service Pack 1" go to runupdatesif %1% == "Service Pack 2" go to endOn another note, I found this link that has what I need but I cant seem to get the syntax of the IF and GO TO statements correct: http://fixunix.com/ms-dos/271139-read-os-s...evel-batch.htmlThanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now