// Author: Jaron, Jiangdu News e-mail: jaron@jdinfo.net URL: http: //www.jiangdu.net If you want to reprint this article, please indicate the source. //
This article explains how to use Microsoft's own adsutil.vbs to modify the setup method of IIS Metabase, here is implemented by calling BAT batch, flexible use, can be used for InstallShield and elsewhere.
Test Environment: Windows 2000 Server Required Files :: 1. Cscript.exe 2. Adsutil.vbs (This file is under C: / INETPUB / Adminscripts) The sub-IIS is created in the target directory. table of Contents
Applications in InstallShield: ######### LaunchappandWait (supportdir ^ "vdir.bat", Szvdir "/" " sztarget " / ""); ######### # Szvdir is a virtual directory name # sztarget is a directory folder name C: / INETPUB / WWWROOT / IIS We implement these features through a BAT.
Vdir.bat details: ### begin ### echo off set vdir =% 1 set vPath =% 2 chDIR% vPath% / IIS Rem CD INETPUB / Adminscripts Cscript Adsutpub / Adminscripts Cscript Adsutil.vbs Delete W3SVC / 1 / ROOT /% VDIR % # Delete Existing Virtual Directory CScript Adsutil.vbs Create_vdir W3SVC / 1 / Root /% VDIR% # Create Virtual Directory CScript Adsutil.vbs Set W3SVC / 1 / Root /% VDIR% / Path% VPath% # Home CSCript Adsutil.vbs set W3SVC / 1 / root /% vdir% / defaultdoc "login.asp" # default document ### end ###
Adsutil.vbs can also achieve a lot of functions, everyone has explored, the following is the help of Adsutil.vbs (English) ======================== ============================================================================================================================================================================================================= ====== Usage: adsutil.vbs cmd [param param]
NOTE: Adsutil Only Supports the "No Switch" option of mDUTIL
Description: IIS K2 Administration Utility That Enables The Manipulation with adsi parameters
Standard MDUTIL Commands: adsutil.vbs GET path - display chosen parameteradsutil.vbs SET path value ... - assign the new valueadsutil.vbs ENUM path [ "/ P" | "/ A"] - enumerate all parameters for given pathadsutil.vbs DELETE path - delete given path or parameteradsutil.vbs CREATE path [KeyType] - create given path and assigns it the given KeyTypeadsutil.vbs APPCREATEINPROC w3svc / 1 / root - Create an in-proc applicationadsutil.vbs APPCREATEOUTPROC w3svc / 1 / root - Create an out-proc applicationadsutil.vbs APPCREATEPOOLPROC w3svc / 1 / root- Create a pooled-proc applicationadsutil.vbs APPDELETE w3svc / 1 / root - Delete the application if there is oneadsutil.vbs APPUNLOAD w3svc / 1 / root - w3svc Unload an application from runtime lookup table.adsutil.vbs APPDISABLE w3svc / 1 / root - Disable an application - appropriate for porting to another machine.adsutil.vbs APPENABLE w3svc / 1 / root - Enable an application - appropriate for importing f Rom Another Machine.adsutil.vbs AppgetStatus W3SVC / 1 / ROOT - Get Status of the Application
New ADSI Options:... / P - Valid for ENUM only Enumerates the paths only (no data) / A - Valid for ENUM only Enumerates all data that CAN be set on the nodeKeyType - Valide for CREATE only Assigns the valid KeyType to the Path
Extended ADSUTIL Commands: adsutil.vbs FIND path - find the paths where a given parameter is setadsutil.vbs CREATE_VDIR path - create given path as a Virtual Directoryadsutil.vbs CREATE_VSERV path - create given path as a Virtual Serveradsutil.vbs START_SERVER path - starts the given web siteadsutil.vbs STOP_SERVER path - stops the given web siteadsutil.vbs PAUSE_SERVER path - pauses the given web siteadsutil.vbs CONTINUE_SERVER path - continues the given web siteSamples: adsutil.vbs GET W3SVC / 1 / ServerBindings adsutil.vbs SET W3SVC / 1 / ServerBindings ": 81:" adsutil.vbs CREATE W3SVC / 1 / Root / MyVdir "IIsWebVirtualDir" adsutil.vbs START_SERVER W3SVC / 1 adsutil.vbs ENUM / P W3SVCExtended ADSUTIL Commands: adsutil.vbs FIND path - find the paths where a given Parameter is setAdsutil.vbs create_vdir path - Create Given path as a virtual directoryadsutil.vbs create_vserv path - Create Given path as a Virtua l Serveradsutil.vbs START_SERVER path - starts the given web siteadsutil.vbs STOP_SERVER path - stops the given web siteadsutil.vbs PAUSE_SERVER path - pauses the given web siteadsutil.vbs CONTINUE_SERVER path - continues the given web site
Samples: adsutil.vbs GET W3SVC / 1 / ServerBindings adsutil.vbs SET W3SVC / 1 / ServerBindings ": 81:" adsutil.vbs CREATE W3SVC / 1 / Root / MyVdir "IIsWebVirtualDir" adsutil.vbs START_SERVER W3SVC / 1 adsutil.vbs ENUM / P W3SVC