Use Iisftpdr.vbs to remove FTP virtual directories (local and remote 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 delete an FTP virtual directory on a local or remote computer running a member of the Windows Server 2003 family with IIS 6.0. This command does not create or destroy content, but simply deletes the virtual directory structure.

You should not use this command to remove FTP sites because these sites may still be listed but partially disabled. To delete an FTP site, use Iisftp.vbs to remove the FTP site.

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/delete Ftpsite[virtualpath]/name [/s Computer [/u [domain\]user/p Password]]

Parameters
Ftpsite

Required. Specifies the descriptive name or metabase path for the FTP site.

VirtualPath

Specifies the path to the virtual directory within the FTP site. This parameter is required when the virtual directory is not in the root directory of the FTP site.

Name

Required. Specify a name for the virtual directory. Virtual directory names do not have to remain unique. However, when an FTP site includes a virtual directory and a physical directory with the same name, the physical directory is not visible on the Internet.

/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 deletes the "Insurance" virtual directory on the local computer's "Finance" FTP site. This not only deletes the directory, but also deletes all the physical and virtual subdirectories.

Copy Code code as follows:

Iisftpdr/delete finance/insurance

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 following message:

Connecting to server ... Done.
FTP directory finance/insurance has been DELETED.

Example 2:

The following example deletes the "Updates" virtual subdirectory on the remote computer's "Finance" FTP site. This command uses the "Finance" FTP Site Configuration database path "msftpsvc/2109607139" to identify the FTP site. It represents the path by attaching the virtual path "Finance/insurance" to the FTP site name.

The example also uses the/s parameter to identify the remote computer and uses the/U and/P parameters to run iisftpdr.vbs with the user's administrator account permissions.

Copy Code code as follows:

Iisftpdr/delete msftpsvc/2109607139/insurance/updates/s svr01/u admin01/p p@ssw#rd2

In response, IISFTPDR displays the following message:

Connecting to server ... Done.
FTP directory Finance/insurance/updates has been DELETED.

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.