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.

Need Help With VBScript Service Pack 3 Checker

Featured Replies

Need some help if anyone is good with vbscript. What I need the script to do is query for the existence of service pack version, and then use logic to say "if servicepack = 3 then msgbox "sp3 installed" or "else msgbox "sp3 not installed". I have pasted what I have into a pastebin in a link below. This was hacked together from 2 previous scripts that I wrote. It's been 6 months or more since I worked with VBscript and I'm sure I'm missing something easy.

http://pastebin.com/m328b3e34

Here is some code that will work for you:

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

For each elem in colItems

If instr(elem.CSDVersion, "2") Then

msgbox "Found Service Pack2"

' Place your code here

Else

If instr(elem.CSDVersion, "3") Then

msgbox "Found Service Pack3"

' Place your code here

End If

End If

Next

  • Author

Thanks paul, much appreciated. Hope I can return the favor.

Here is another script that will list if the service pack is installed

Option Explicit
Dim ColItems, ObjItem, SvcVer, Wmi
Set Wmi = GetObject("winmgmts:\\.\root\CIMV2")
Set ColItems = Wmi.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48)
For Each ObjItem in ColItems
SvcVer = ObjItem.ServicePackMajorVersion
If SvcVer = 1 Then WScript.Echo "Service Pack 1 Installed"
If SvcVer = 2 Then WScript.Echo "Service Pack 2 Installed"
If SvcVer = 3 Then WScript.Echo "Service Pack 3 Installed"
If SvcVer = "" Then WScript.Echo "No service Pack Installed"
Next

  • 1 month later...

This is good stuff and just what I'm looking for.

Does anybody know who to check whether Office 2007 SP1 is installed or not in the same script?

Thanks in advance everyone.

Keep up the good work :thumbup

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.