Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6249709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:17:21+00:00 2026-05-24T13:17:21+00:00

Anyone know how I might create a script to assign a group of extensions

  • 0

Anyone know how I might create a script to assign a group of extensions to the framework aspnet_isapi.dll file? I have to do about 20 to each website (about 40 sites) and it is incredibly tedious to do it through the IIS Manager interface.

Thanx.ApplicationExtension Mapping

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:17:21+00:00Added an answer on May 24, 2026 at 1:17 pm

    Try this VBScript…I think it will do what you need. Just save it in a .vbs file (change the arrays at the beginning for your websites and extensions) and from a CommandPrompt in the System32 folder run “cscript yourfile.vbs”.

    Hope it helps (and works 🙂 ) I have IIS7 so couldn’t fully test in IIS6. Let me know if you run into problems and I’ll try to tweak it.

    Oh and Thanks to @Cheeso for some code I “borrowed” from his self-answered question.

    Dim arrExtensions(2)
    arrExtensions(0) = ".tst1"
    arrExtensions(1) = ".tst2"
    arrExtensions(2) = ".tst3"
    
    Dim arrSites(1)
    arrSites(0) = "Default Web Site"
    arrSites(1) = "Test"
    
    Dim iis
    iis = GetObject("winmgmts://localhost/root/MicrosoftIISv2")
    
    For s = 0 To ubound(arrSites)
        ' Get the settings for this web site '
        iisSettings = iis.ExecQuery("SELECT * FROM IIsWebServerSetting WHERE ServerComment = '" & arrSites(s) & "'")
    
        For e = 0 To ubound(arrExtensions)
            ReDim newMaps(0)
            ' two passes '
            For t = 0 To 1
                Dim c
                c = 0
                For Each item In iisSettings
                    ' in pass 1, count them. '
                    ' in pass 2, copy them. '
                    For i = 0 To Ubound(item.ScriptMaps)
                        If UCase(item.ScriptMaps(i).Extensions) <> ucase(arrExtensions(e)) Then
                            If t = 1 Then
                                newMaps(c) = item.ScriptMaps(i)
                            End If
                            c = c + 1
                        End If
                    Next
    
                    If t = 0 Then
                        ReDim Preserve newMaps(c)
                    Else
                        newMaps(c) = iis.get("ScriptMap").SpawnInstance_()
                        newMaps(c).Extensions = arrExtensions(e)
                        newMaps(c).ScriptProcessor = "%Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
                        newMaps(c).Flags = "1"
                        newMaps(c).IncludedVerbs = "ALL"
                        item.ScriptMaps = newMaps
                        item.Put_()
                    End If
                Next
    
            Next
    
        Next
    Next
    
    iisSettings = Nothing
    iis = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone know a good book or post about how to start in EF? I
Anyone know how to do picture overlay or appear on top of each other
Does anyone know how to create a dynamic textfield with a visible border and
Anyone know if it's possible to databind the ScaleX and ScaleY of a render
Anyone know of a way to capture keyboard events (keyup / keydown) in Portable
Anyone know how to do this without using a third party program? If there
Anyone know this compiler feature? It seems GCC support that. How does it work?
Anyone know? Want to be able to on the fly stamp an image with
Anyone know how to turn off code folding in visual studio 2008? Some of
Anyone know if it is possible to write an app that uses the Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.