日期:2014-05-17 浏览次数:20875 次
serverComment = "这里填写站点名"
Set objIIsService = GetObject("winmgmts:\\.\root\microsoftiisv2")
Set colWebsites = objIIsService.ExecQuery("SELECT * FROM IIsWebServerSetting WHERE ServerComment='"&serverComment&"'")
If colWebsites.Count < 1 Then
MsgBox "没有这个网站"
Wscript.Quit
Else
For Each objWebsite In colWebsites
name = objWebsite.Name
Next
End If
Set objIIsWebVirtualDirSetting = GetObject("winmgmts:\\.\root\microsoftiisv2:IIsWebVirtualDirSetting.Name='"&name&"/root'")
For Each scriptMap In objIIsWebVirtualDirSetting.ScriptMaps
If scriptMap.Extensions = ".aspx" Then
path = scriptMap.ScriptProcessor
If InStr(path,"v1.1")>0 Then MsgBox "ASP.NET版本为1.1"
If InStr(path,"v2.0")>0 Then MsgBox "ASP.NET版本为2.0"
If InStr(path,"v4.0")>0 Then MsgBox "ASP.NET版本为4.0"
End If
Next