Delen via


Deleting FTP Sites Using Iisftp.vbs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can use the command-line script iisftp.vbs, which is stored in systemroot\System32\, to delete IIS File Transfer Protocol (FTP) site configurations on local or remote computers running a member of the Windows Server 2003 family with IIS 6.0.

This command is useful if you plan to move the site to a new URL or server, or if you intend to remove it entirely. The content within the site is unaffected by this command, but the site will be inaccessible to users.

Important

You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any parameters).

This topic includes the following information:

  • Syntax: The order in which you type a command and any arguments and options that follow it.

  • Parameters: The values that are given to variables in the command.

  • Examples: Sample code and an explanation of the results.

Syntax

iisftp /delete FTPSite [FTPSite...] [/s Computer [/u [Domain\]User**/p** Password]]

Parameters

FTPSite

Required. Specifies the site name or metabase path of the FTP site. FTP sites must be uniquely identified. If more than one FTP site has the same descriptive name, you must use the metabase path to identify the FTP site.

/s Computer

Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. By default, the script runs on the local computer.

/u [Domain\]User

Runs the script with the permissions of the specified user account. This 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 of the user account that is specified in the /u parameter.

Examples

Example 1:

The following example deletes a single FTP site configuration on a local computer. The content of the "Downloads" FTP site remains unchanged, but will be unavailable to users. The /s parameter is omitted because the local computer is the default setting. The /u and /p parameters are omitted because the current user of the local computer must be logged on as an administrator to run the command.

iisftp /delete Downloads

In response, iisftp displays the following message indicating that the site configuration has been deleted, and identifying the FTP site by its metabase path. The metabase path is the IIS equivalent of an entry in the system registry.

Connecting to server ...Done.

Server MSFTPSVC/2109607139 has been DELETED.

Example 2

The following example deletes multiple FTP site configurations from a remote computer. The "Downloads", "Drivers", and "Library" FTP sites reside on SVR01. The command identifies the first two sites by name and the "Logo" FTP site by its metabase path, "MSFTPSVC/1932955329". In addition, the command uses the /s parameter to specify the remote computer and the /u and /p parameters to run the commands with the permissions of the user's administrator account.

iisftp /delete Downloads Drivers MSFTPSVC/2109607139 /s Svr01 /u Tom /p p@##word

In response, iisftp displays the following message indicating that the site configurations have been deleted, and identifying each FTP site by its metabase path.

Connecting to server ...Done.

Server MSFTPSVC/2109607139 has been DELETED.

Server MSFTPSVC/1879143292 has been DELETED.

Server MSFTPSVC/1932955329 has been DELETED.