sol15-3b.vbs

来自「Apress - Managing Enterprise Systems Wit」· VBS 代码 · 共 20 行

VBS
20
字号
Dim objService, objFTPSite, objVirtDir

'get a reference to the FTP service on server Thor 
Set objService = GetObject("IIS://thor/MSFTPSVC")

'create a new FTP site and assign it the value of 6 as it's 'name'
Set objFTPSite = objService.create("IIsFTPServer", 6)
'assign a friendly comment to appear in the IIS MMC
objFTPSite.ServerComment = "Accounting FTP Site"

'bind the site to an IP address and distinguished name
objFTPSite.ServerBindings = Array("192.168.1.40:21:ftp.accounting.acme.com")
objFTPSite.SetInfo

'create a virtual ROOT directory for the site
Set objVirtDir = objFTPSite.create("IIsFTPVirtualDir", "ROOT")
objVirtDir.Accessread = True
objVirtDir.Path = "f:\inetpub\ftp" 'set the FTP directory
objVirtDir.SetInfo

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?