In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how to use iisvdir.vbs iis virtual directory management script". In daily operation, I believe many people have doubts about how to use iisvdir.vbs iis virtual directory management script. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to use iisvdir.vbs iis virtual directory management script". Next, please follow the editor to study!
The IIS manager also calls iisvdir.vbs to create and delete virtual directories. We can execute iisvdir.vbs scripts on the command line
1) create a virtual directory:
Cscript c:\ windows\ system32\ iisvdir.vbs [/ s server] [/ u username / p password] / create [virtualRoot] Alias PhysicalPath
2) Delete the virtual directory:
1cscript c:\ windows\ system32\ iisvdir.vbs [/ s server] [/ u username / p password] / delete [virtualRoot] / Alias
3) View all subdirectories under the specified virtual directory:
1cscript c:\ windows\ system32\ iisvdir.vbs [/ s server] [/ u username / p password] / query virtualRoot
Apply to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
Iisvdir.vbs:IIS virtual directory script
Create and delete a virtual directory for a Web site on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
To view the command syntax, click the following command:
Iisvdir / create
Iisvdir / delete
Iisvdir / query
Iisvdir / create
Create a virtual directory for the Web site on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Grammar
Iisvdir [.vbs] / create website [/ VirtualPath] Name PhysicalPath [/ sComputer [/ u [Domain\] User [/ p Password]
Parameters.
WebSite
Necessary. Specify the descriptive name of the site or the configuration database path.
VirtualPath
Specify the path to the virtual directory within the site. The virtual path does not contain the name of the virtual directory.
This parameter places the virtual directory in a subdirectory of the site. By default, virtual directories are added to the root of the site. All directories in the virtual path must already exist on the site.
Name
Necessary. Specifies the name of the virtual directory. You can choose any name.
PhysicalPath
Necessary. Specifies the physical directory of the virtual directory.
You must specify a path on the local computer, such as C:\ Project\ HTML. If the specified path does not exist, Iisvdir.vbs creates the path.
/ s Computer
Runs the script on the specified remote computer. Type the computer name or IP address without a backslash. By default, scripts run on the local computer.
/ u [Domain\] User
Runs the script with the privileges of the specified user account. The account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user on the local computer.
/ p Password
Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.
/?
Displays help at the command prompt.
Annotation
To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.
The WebSite (or WebSite/VirtualPath) Name and PhysicalPath parameters must always appear in the order specified on the command line. Otherwise, Iisvdir.vbs will not interpret the information correctly.
When you use Iisvdir.vbs to create a new virtual directory, you specify only the basic properties required to create the site and identify its contents. The default properties used by Iisvdir.vbs are the same as those used by IIS when creating a new virtual directory, which conforms to the rules for inheriting properties. To configure more advanced properties of the site, use IIS Manager.
The virtual directory name (Name) does not need to be unique. However, when the site includes a virtual directory with the same name as a physical directory, you will not be able to see the contents of the physical directory on the Internet.
Example
The following example shows how to use iisvdir / create in specific situations.
Create a virtual directory under the root of the website
The following command creates a virtual directory called Insurance under the root of the Finance Web site on your local computer. It associates this directory with the contents currently stored in the C:\ Projects\ Insurance\ Html directory.
The copy code is as follows:
Iisvdir / create Finance Insurance c:\ projects\ insurance\ html
In response, Iisvdir.vbs displays the following message indicating that the command was executed successfully, along with the basic properties of the new virtual directory:
Connecting to server... Done.Virtual Path = Finance/Insurance ROOT = c:\ projects\ insurance\ html Metabase Path = W3SVC/1509060625/ROOT/Insurance
The WebSite, Name, and PhysicalPath parameters must appear in the order specified in the command. The following command is the same as the previous command, except that the parameter order is different:
Iisvdir / create c:\ projects\ insurance\ html Finance Insurance
The command failed, the parameters were misinterpreted, and Iisvdir.vbs will report that the Web site named "c:" could not be found.
Create a virtual directory in the site path
The following command creates a virtual directory named Updates on the Finance Web site of the remote server Svr01. It uses the / s command to identify the server computer and the / u and / p commands to run Iisvdir.vbs with the privileges of the user's administrator account.
This command creates the new virtual directory as a subdirectory of the Finance/Insurance directory. This command uses the configuration database path W3SVC/1509060625 of the Finance Web site to identify the site. It indicates the virtual path Finance/Insurance by appending it to the site name.
Finally, this command associates the Updates directory with the content stored on the remote computer C:\ Newstuff\ Web.
Iisvdir / createW3SVC/1509060625/InsuranceUpdatesC:\ Newstuff\ Web/s svr01/u Admin01/p p@SSw#rD2
In response, Iisvdir.vbs displays the following message indicating that the command was executed successfully, along with the basic properties of the new virtual directory:
Connecting to server... Done.Virtual Path = Finance/Insurance/Updates ROOT = C:\ Newstuff\ Web Metabase Path = W3SVC/1509060625/ROOT/Insurance/Updates
In this example, the Finance site and its Insurance subdirectory already exist on the Svr01 IIS server before issuing the command. If the Web site or its subdirectories do not exist, the command may fail.
In addition, the Insurance subdirectory is a virtual directory. You can use Iisvdir.vbs to create virtual paths within a real directory or a virtual directory.
Create a virtual directory to hide the physical directory
This example uses the unnatural signals of the virtual directory to hide the contents of the physical directory so that they will not be seen on Internet or Intranet. This command creates a virtual directory with the same name as the physical directory in the same virtual path to the Web site. In this way, Web users will not see the contents of the physical directory.
Although this method does not secure physical directories, it provides a precaution to protect privacy.
The following command creates a virtual directory called Personnel under the root of the Finance Web site. The virtual directory is related to the physical directory D:\ IIStest\ Personnel that contains common information about people in the Finance department.
Iisvdir / create Finance Personnel D:\ IIStest\ Personnel
In response, Iisvdir.vbs displays the following message indicating that the command was executed successfully, along with the basic properties of the new virtual directory:
Connecting to server... Done.Virtual Path = Finance/Personnel ROOT = D:\ IIStest\ Personnel Metabase Path = W3SVC/1509060625/ROOT/Personnel
After using this command, the site will have a physical directory and a virtual directory named Personnel. Users who visit the Finance website will see the contents of the Personnel virtual directory. These users cannot see the contents of the Personnel physical directory.
Iisvdir / delete
Delete the virtual directory of the Web site on the server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Grammar
Iisvdir [.vbs] / delete Web site [/ VirtualPath] / Name [/ s Computer [/ u [Domain\] User [/ p Password]
Parameters.
WebSite
Necessary. Specify the descriptive name of the site or the configuration database path.
VirtualPath
Specifies the path to the virtual directory. This parameter is required when the virtual directory is not under the root of the site.
Name
Necessary. Specifies the name of the virtual directory.
/ s Computer
Runs the script on the specified remote computer. Type the computer name or IP address without a backslash. By default, scripts run on the local computer.
/ u [Domain\] User
Runs the script with the privileges of the specified user account. The account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user on the local computer.
/ p Password
Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.
/?
Displays help at the command prompt.
Annotation
To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.
Do not use Iisvdir.vbs to delete websites. If you do so, the site will still be listed, but it will be partially deleted and will not function properly. To delete a site through Iisvdir.vbs, or to correct an incorrect deletion of a site, use the Iisweb.vbs:IIS site Administration script.
Example
The following example shows how to use iisvdir / delete in specific situations.
Delete virtual directory
The following command removes the Insurance virtual directory from the Finance site on the local server. As a result, all actual and virtual subdirectories of the Insurance directory and the Insurance directory will be deleted.
Iisvdir / deleteFinance/Insurance
In response, Iisvdir.vbs displays the following message indicating that the command was executed successfully. Note that Iisvdir.vbs does not require confirmation before deleting a directory or its subdirectories.
Web directory Finance/ROOT/Insurance has been DELETED.
Iisvdir / query
Display the virtual directory of the Web site on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Grammar
Iisvdir / query website [/ VirtualPath] [/ s Computer [/ u [Domain\] User [/ p Password]
Parameters.
WebSite
Necessary. Specify the descriptive name of the site or the configuration database path.
VirtualPath
Specify the path to the directory within the site. This query lists all virtual directories under the specified directory. If you do not use this parameter, Iisvdir.vbs lists the virtual directories under the root of the site.
/ s Computer
Runs the script on the specified remote computer. Type the computer name or IP address without a backslash. By default, scripts run on the local computer.
/ u [Domain\] User
Runs the script with the privileges of the specified user account. The account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user on the local computer.
/ p Password
Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.
/?
Displays help at the command prompt.
Annotation
To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.
The query operation displays only virtual directories. Physical directories in the site or path are not displayed.
The query operation displays only virtual directories under the root or specified subdirectories of the site. It does not perform a recursive search.
Example
The following example shows how to use iisvdir / query in specific situations.
Display the virtual directory of the website
The following command displays the virtual directory under the root of the Finance website:
The copy code is as follows:
Iisvdir / query Finance
In response, Iisvdir.vbs displays two virtual directories under the root of the Finance. Note that these directories will appear under the Finance root, even if their physical locations are not relevant.
The display does not include virtual directories as site subdirectories. The process of finding subdirectories is illustrated in the following example, "Show virtual subdirectories."
Alias Physical Root = / Personnel D:\ Corpdir\ FinanceWeb\ People / Insurance C:\ Marketing\ Insurance\ HTMFiles
Show virtual subdirectories
The following command displays virtual directories that are subdirectories of the Insurance virtual directory on the Finance site. This command specifies the Insurance directory by using its virtual directory path.
Iisvdir / query Finance\ Insurance
This command displays the Current subdirectory of the Insurance virtual directory.
Alias Physical Root = / Current C:\ Insurance\ Monthly\ 200204
Annotation
Iisvdir.vbs can perform the same operation provided in the IIS Manager. You can use any tool to view and manage virtual directories.
The computer that issued the command must be running the Windows XP or Windows Server 2003 operating system. The user must be a member of the Administrators group on the computer affected by the command.
The computer affected by the command must be a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
When you connect to the IIS service on the specified computer, Iisvdir.vbs displays a "connecting to server" message. This message appears every time you use Iisback.vbs, whether you run the command on a local or remote computer.
Enclose path elements that contain spaces in quotation marks. Enclose only elements with spaces, not the entire path. For example, type "Default Web Site" / IISAdmin instead of "Default Web Site/IISAdmin".
At this point, the study on "how to use iisvdir.vbs iis virtual directory management script" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.