[[VBScript]]

#pre(){{
Const Impersonate = "winmgmts:{impersonationLevel=impersonate}!\\"
computer = "."
Set oWMI = GetObject(Impersonate & computer & "\root\cimv2")
Set QueryWMI = oWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem")
For Each oItem In QueryWMI
 spVer = oItem.ServicePackMajorVersion
Next
 Const Impersonate = "winmgmts:{impersonationLevel=impersonate}!\\"
 computer = "."
 Set oWMI = GetObject(Impersonate & computer & "\root\cimv2")
 Set QueryWMI = oWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem")
 For Each oItem In QueryWMI
  spVer = oItem.ServicePackMajorVersion
 Next
 
 MsgBox "This computer has Service Pack " & spVer & " is installed."

MsgBox "This computer has Service Pack " & spVer & " is installed."

}}


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS