- Set objWMIService = GetObject("winmgmts:\\Localhost\root\MicrosoftIISv2")
- Set colItems = objWMIService.ExecQuery("SELECT * FROM IIsWebInfo", "WQL", 48)
- strVersion = ""
- For Each objItem In colItems
- strVersion = "IIS Version: " & objItem.MajorIIsVersionNumber & "." & objItem.MinorIIsVersionNumber
- Next
- WScript.Echo strVersion
复制代码
|