Create a virtual directory using the AdminScripts script

Source: Internet
Author: User

AdminScripts script is located in the \Inetpub\Adminscripts directory, this article describes how to use these scripts to create a virtual directory and to set parameters for that virtual directory.

There are a lot of scripts in the AdminScripts directory, and only two of them are used here, Adsutil.vbs and Chaccess.vbs:

Adsutil.vbs-can be used to create and configure virtual directories (in fact, Adsutil.vbs features cover all other scripts)

Chaccess.vbs-Set permissions on virtual directories

The following is the content of the batch script Makevd.bat, starting with a description of how the batch script is invoked:

Makevd.bat "virtual directory Name" "Virtual directory Path"

Example: Makevd.bat "Myvirtualdirectory" "D:\myweb\test"

The next step is Makevd.bat's content:

The following is a reference fragment:
@echo off
Echo ######################################################
Echo ######### ########
Echo ######### is creating a virtual directory ... ########
echo ######### Please do not close this window! ########
Echo ######### ########
Echo ######################################################
REM Create a virtual directory
cscript scripts\adsutil.vbs//nologo//t:300 create w3svc/1/root/%1 "IIsWebVirtualDir"
REM set the properties of a virtual directory
REM creates an in-process application (. NET has no InProc and Outproc, but old scripts can still be used.
cscript scripts\adsutil.vbs//nologo//t:60 Appcreateinproc w3svc/1/root/%1
REM set the root directory of the application
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/approot/lm/w3svc/1/root/%1
REM set the display name of the application
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/appfriendlyname%1
REM sets the isolation level of the application (in. NET without setting)
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/appisolated 2
REM set the path of the virtual directory
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/path%2
REM sets the Execute permissions on the virtual directory, 513 is a pure scripting way
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/accessflags 513
REM set AuthFlags value, 5 indicates allow anonymous access and integrated Windows authentication
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/authflags 5
REM set the DirBrowseFlags value, DirBrowseFlags is the control of directory browsing switch parameters, more complex, just fill in the line
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/dirbrowseflags 1073741886
REM Set Default Document
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/defaultdoc "default.aspx"
REM Set directory permissions (readable, non-writable, browsable script resource, not viewable directory)
cscript scripts\chaccess.vbs//nologo//t:60-a w3svc/1/root/%1 +read-write
Nologo and//t:60 are cscript running parameters, setting the running display mode and maximum running time, respectively.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.