IISFtpdr.vbs: IIS FTP directory script
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
IISFtpdr.vbs: IIS FTP directory script
Creates, deletes, and displays virtual directories on FTP sites of servers running Windows Server 2003 with Internet Information Services (IIS) 6.0.
To view the command syntax, click a command:
iisftpdr /create
iisftpdr /delete
iisftpdr /query
iisftpdr /create
Creates virtual directories on FTP sites of servers running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Syntax
iisftpdr[.vbs] /create FTPSite [/VirtualPath] Name PhysicalPath [/s Computer [/u [Domain**\]User [/p** Password]]]
Parameters
- FTPSite
Required. Specifies the descriptive name or metabase path of the FTP site.
- VirtualPath
Specifies a path to the virtual directory within the FTP site. The virtual path does not include the name of the virtual directory.
This parameter places the virtual directory in a subdirectory of the FTP site. By default, the virtual directory is added to the root of the FTP site. All directories in the virtual path must already exist on the FTP site.
- Name
Required. Specifies a name for the virtual directory.
- PhysicalPath
Required. Specifies the physical directory that stores content for the virtual directory.
You must specify a path on the local computer, such as C:\\Project\\HTML. If the specified path does not exist, then Iisftpdr.vbs creates the path.
- /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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
- /?
Displays help at the command prompt.
Remarks
To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.
The FTPSite (or FTPSite**/**VirtualPath), Name, and PhysicalPath parameters must always appear in the specified order on the command line. Otherwise, Iisftpdr.vbs does not interpret the information correctly.
When you use Iisftpdr.vbs to create a new virtual directory, you specify only the basic properties needed to create the directory and identify its contents. Iisftpdr.vbs uses the same default properties that IIS uses when establishing new virtual directories, and adheres to the same rules for inheriting properties. To configure the more advanced properties of the site, use IIS Manager.
Examples
The following examples show how to use iisftpdr /create in specific situations.
To create a virtual directory at the root of the FTP site
The following command creates a virtual directory called Scripts at the root of the Test Downloads FTP site on the local computer. It associates the directory with content currently stored in the C:\Libraries\Scripts directory.
iisftpdr /create"Test Downloads" Scripts c:\libraries\scripts
In response, Iisftpdr.vbs displays the following message, which indicates that the command was successful, and it also displays the basic properties of the new virtual directory.
Connecting to server ...Done.
Virtual Path = Test Downloads/Scripts
ROOT = c:\libraries\scripts
Metabase Path = MSFTPSVC/577648624/ROOT/Scripts
The FTPSite (or FTPsite**/**VirtualPath), Name, and PhysicalPath parameters must always appear in the specified order on the command line. The following command is the same as the previous command except that the parameters are out of order:
iisftpdr /createc:\libraries\scripts"Test Downloads"Scripts
This command fails, and having misinterpreted the parameter, Iisftpdr.vbs reports that it cannot find an FTP site called "C:."
To create a virtual directory in an FTP site path
The following command adds a virtual directory called Updates to the FTP site of a remote server, Svr01. The command creates the new virtual directory on the Finance FTP site as a subdirectory of an existing virtual directory called Documents.
The first parameter in the command identifies the FTP site and virtual path, Finance\Documents. The second parameter, Updates, specifies the name of the virtual directory. The third parameter specifies the physical directory on Svr01 that stores the content of the virtual directory.
The command uses the /s command to identify the server computer, and the /u and /p commands to run Iisftpdr.vbs with the permissions of the user's Administrator account.
iisftpdr /createFinance/DocumentsUpdatesC:\inetpub\ftproot\documents\updates/s svr01/u Admin01/p p@SSw#rD2
In response, Iisftpdr.vbs displays the following message, which indicates that the command was successful, and it also displays the basic properties of the new virtual directory:
Connecting to server ...Done.
Virtual Path = Finance/Documents/Updates
ROOT = C:\inetpub\ftproot\documents\updates
Metabase Path = MSFTPSVC/2109607139/ROOT/Documents/Updates
In this example, the Finance FTP site and its Documents subdirectory existed on the Svr01 IIS server before the command was issued. If the FTP site or the subdirectory did not exist, the command would have failed.
iisftpdr /delete
Deletes virtual directories from FTP sites of servers running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Syntax
iisftpdr[.vbs] /delete FTPSite [/VirtualPath] /Name [/s Computer [/u [Domain**\]User [/p** Password]]]
Parameters
- FTPSite
Required. Specifies the descriptive name or metabase path of the FTP site.
- VirtualPath
Specifies the path to the virtual directory. This parameter is required when the virtual directory is not located at the root of the FTP site.
- / Name
Required. 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 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
- /?
Displays help at the command prompt.
Remarks
To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.
Do not use Iisftpdr.vbs to delete an FTP site. If you do, the FTP site is still listed, but it is partially removed and does not operate properly. To delete an FTP site, or to correct the improper removal of an FTP site by Iisftpdr.vbs, use Iisftp.vbs: IIS FTP site management script.
Examples
The following examples show how to use iisftpdr /delete in specific situations.
To delete a virtual directory
The following command deletes the Insurance virtual directory from the Finance FTP site on the local server. As a result, the Insurance directory and all virtual subdirectories of the Insurance directory are deleted.
iisftpdr /deleteFinance/Insurance
In response, Iisftpdr.vbs displays the following message indicating that the command was successful. Note that Iisftpdr.vbs does not ask for confirmation before deleting the directory or its subdirectories.
FTP directory Finance/Insurance has been DELETED.
iisftpdr /query
Displays the virtual directories of FTP sites on servers running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Syntax
iisftpdr[.vbs] /query FTPSite [/VirtualPath] [/s Computer [/u [Domain**\]User [/p** Password]]]
Parameters
- FTPSite
Required. Specifies the descriptive name or metabase path of the FTP site.
- VirtualPath
Specifies the path to a directory within the FTP site. The query lists all virtual directories under the specified directory. Without this parameter, Iisftpdr.vbs lists the virtual directories at the root of 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
- /?
Displays help at the command prompt.
Remarks
To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.
The query operation displays only virtual directories. Physical directories in the FTP site or path do not appear.
Examples
The following examples show how to use iisftpdr /query in specific situations.
To display the virtual directories of an FTP site
The following command displays the virtual directories at the root of the Test Downloads FTP site:
iisftpdr /query "Test Downloads"
In response, Iisftpdr.vbs displays the Scripts virtual directory at the root of Test Downloads. Note that the directory appears at the Test Downloads root even though its physical location is unrelated.
Alias Physical Root
==============================================================================
/Scripts C:\Libraries\Scripts
This display does not include virtual directories that are subdirectories of the site. The procedure for finding subdirectories is demonstrated in "To display virtual subdirectories."
To display virtual subdirectories
The following command displays the virtual directories that are subdirectories of the Scripts virtual directory on the Test Downloads FTP site. The command specifies the Scripts virtual directory by using its virtual path. Note that the quotation marks enclose only the path component that requires them.
iisftpdr /query "Test Downloads"\Scripts
This command reveals the VBScripts subdirectory of the Scripts virtual directory, as shown in the following output:
Alias Physical Root
==============================================================================
/VBScripts D:\Scripts\Vbscripts
Remarks
Iisftpdr.vbs performs the same operations that are available from IIS Manager. You can use either tool to view and manage virtual directories.
The computer issuing the command must be running Windows XP or a server running Windows Server 2003. The user must be a member of the Administrators group on any computer that the command affects.
The computer that the command affects must be a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.
Iisftpdr.vbs displays a "Connecting to server" message while it connects to the IIS service on the specified computer. This message appears whenever you use Iisftpdr.vbs, whether on a local or a remote computer.
Use quotation marks to enclose path elements that include spaces. Enclose only the element with spaces, not the entire path. For example, type "Default FTP Site"/IISAdmin, not "Default FTP Site/IISAdmin".
Formatting legend
Format | Meaning |
---|---|
Italic |
Information that the user must supply |
Bold |
Elements that the user must type exactly as shown |
Ellipsis (...) |
Parameter that can be repeated several times in a command line |
Between brackets ([]) |
Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} |
Set of choices from which the user must choose only one |
|
Code or program output |
See Also
Concepts
Iisapp.vbs: IIS application query script
Iisback.vbs: IIS backup management script
Iiscnfg.vbs: IIS configuration script
Iisext.vbs: IIS Web service extension script
Iisftp.vbs: IIS FTP site management script
Iisvdir.vbs: IIS virtual directory script
Iisweb.vbs: IIS Web site management script
Command-line reference A-Z
Command shell overview