Use Iisftpdr.vbs to list FTP virtual directories (remote and local support) _vbs

Source: Internet
Author: User
Tags ftp site

Applied to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can use command-line scripting Iisftpdr.vbs (stored in systemroot\system32) to list the FTP virtual directories on a local or remote computer running a member of the Windows Server 2003 family with IIS 6.0.

The/query operation displays only the virtual directory and does not display the physical directory. Also, it displays only virtual directories located at the root of the FTP site or path and does not perform a recursive search.

Important matters

Only members of the Administrators group on the local computer can run scripts and executables. As a security best practice, log on to the computer using an account that is not part of the Administrators group, and then use the runas command to run scripts and executables as an administrator. At the command prompt, type runas/profile/user:mycomputer\administrator cmd, open a command window with administrator privileges, and then type Cscript.exescriptname (including the full path and any parameters of the script).

This topic includes the following information:

• Syntax: The order in which you type the command and any parameters and options that follow it.
• Parameter: Gives the value of the variable in the command.
• Example: Sample code and a description of the result.

Grammar
Iisftpdr/query ftpsite[/virtualpath][/s Computer [/u [Domain \]user/p Password]]

Parameters
Ftpsite

Required. Specifies the descriptive name or metabase path of the Web site.

VirtualPath

If necessary, specify a path to the virtual directory within the Web site. This parameter is required when the virtual directory is not in the root directory of the Web site.

/s Computer

Runs the script on the specified remote computer. Type the name or IP address of the computer without the backslash. The default is the local computer.

/u [domain\]user

Runs the script with the permissions 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 of the local computer.

/P Password

Specifies the password for the user account specified in the/u parameter.

Example

Example 1:

The following example shows the virtual directory located on the local computer on the FTP site "Test Downloads" root:

Copy Code code as follows:

Iisftpdr/query "Test Downloads"

Because the default computer is the local computer and the user who is running the command must be logged on as an administrator, the/S,/U, and/p parameters are not required in this case.

In response, IIsFtpDr displays the "Scripts" virtual directory located in the root directory of the FTP site "Test Downloads". Note that the directory appears in the root directory even if the actual location of the directory is not relevant.

Note
The display does not include a virtual directory as a site subdirectory. The procedure for locating subdirectories is shown in the following example 2.

Alias Physical Root
/scripts C:\Libraries\Scripts

Aliases represent the names of virtual directories, and the physical root describes their actual location.

Example 2

The following example shows a virtual directory that is a subdirectory of the "Scripts" virtual directory on the FTP site "Test Downloads". This command specifies it by using the virtual path of the "Scripts" directory. Note that the quotes enclose only the part of the path that requires them.

Copy Code code as follows:

Iisftpdr/query "Test Download" \scripts

In response, IIsFtpDr displays the VBScripts subdirectory of the virtual directory "Scripts".

Alias Physical Root
/vbscripts D:\Scripts\VBScripts

Of course, we can use the combination of bat to achieve bulk operation, if the combination of scheduled tasks can be completed on time task, convenient and quick.

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.