Friday, June 5, 2026 Sign InRegister FREE My Account Help
FDN Portal
FDN » IIS » Virtual Directories in IIS

Virtual Directories in IIS

Virtual Directories in IIS

A virtual directory maps an alias in the URL space to a physical directory on disk (or a network share). Virtual directories let you organize web content without matching the physical folder structure.

Creating a Virtual Directory

  1. Open Internet Services Manager.
  2. Expand the target web site.
  3. Right-click the site → NewVirtual Directory.
  4. Enter an alias (e.g., docs). This becomes the URL path: http://server/docs/.
  5. Browse to the physical path (e.g., D:\Documentation).
  6. Set permissions: Read, Run scripts (ASP), Execute (CGI/ISAPI), Write, Browse.
  7. Click Finish.

Virtual Directory vs. Application

A virtual directory becomes an application when it runs in its own application space. Applications have their own Session and Application objects in ASP.

To create an application from a virtual directory:

  1. Right-click the virtual directory → Properties.
  2. Under Application Settings, click Create.
  3. Choose the application protection level:
    • Low (IIS Process): Runs in inetinfo.exe — fastest but a crash takes down IIS.
    • Medium (Pooled): Runs in a shared dllhost.exe pool — default and recommended.
    • High (Isolated): Runs in its own dllhost.exe — most stable but uses more memory.

Mapping to a UNC Path

To map a virtual directory to a network share, enter the UNC path (\fileserver\share\docs) and provide credentials with read access. IIS uses these credentials to access the remote content.

Scripting with ADSI

' Create a virtual directory programmatically using ADSI
Set objWeb = GetObject("IIS://localhost/W3SVC/1/Root")
Set objVDir = objWeb.Create("IIsWebVirtualDir", "docs")
objVDir.Path = "D:\Documentation"
objVDir.AccessRead = True
objVDir.AccessScript = True
objVDir.SetInfo
WScript.Echo "Virtual directory /docs created."
Next » ISAPI Extensions Guide
More in IIS
« Back to IIS « Back to FDN
FlameNet Weekly: the best of the forum, freshest listings, top Q&A — delivered every Sunday.
13 members · 0 new today · 0 online now · 777 posts in last 24h