Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to properly query the service pack version from the registry

Featured Replies

Can anyone tell me whats wrong with this command?

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion"

Thanks in advance!

Use:

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion

Edited by nullbyte

Thank you! :thumbup

No problem, /v queries for a specific key, and /s queries all subkeys and values.

  • Author

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 runupdates
if %1% == "Service Pack 2" go to end

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

Thanks in advance!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.