使用VBS脚本查找IIS元数据库中的所有 MIME 类型

下面的脚本将显示 Microsoft Internet 信息服务 (IIS) 5.0 或 Microsoft Internet 信息服务 (IIS) 6.0 元数据库中的所有 MIME 类型。

' This script lists the MIME types for an IIS Server.
' To use this script, just double-click or execute it from a command line
' by calling cscript.exe

dim mimeMapEntry, allMimeMaps

' Get the mimemap object.
Set mimeMapEntry = GetObject("IIS://localhost/MimeMap")
allMimeMaps = mimeMapEntry.GetEx("MimeMap")

' Display the mappings in the table.
For Each mimeMap In allMimeMaps
    WScript.Echo(mimeMap.MimeType & " (" & mimeMap.Extension + ")")
Next

将脚本另存为 .vbs 文件(例如,DiscoverIISMimeTypes.vbs),然后从命令提示窗口使用以下命令运行它:

cscript DiscoverIISMimeTypes.vbs

不允许评论