VBS 使用WMI检查本机是否安装了.NET Framework

'WMI检查本机是否安装了.NET Framework
Public Function IsMSFrameworkInstalled() As Boolean
On Error Resume Next
Dim
objWMIService
Dim colItems
Dim objItem
Set objWMIService = GetObject( "winmgmts:\\.\root\cimv2" )
Set colItems = objWMIService.ExecQuery( "Select * from Win32_Product" )
For Each objItem In colItems
If InStr(objItem.Name, "Microsoft .NET Framework" ) > 0 Then
IsMSFrameworkInstalled = True
End If
Next
End Function

 

你可能感兴趣的:(.net,Microsoft)