//////////////////////////
作者:Jaron,江都资讯网
邮件:jaron@jdinfo.net
网址:http://www.jiangdu.net
如果您要转载该文章,请注明出处。
//////////////////////////
本文解释如何用Microsoft自带的adsutil.vbs来修改IISMetabase的设置方法,这里是通过调用BAT批处理的方法来实现的,灵活运用一下,可以用于InstallShield和其他地方。
测试环境:Windows2000Server(装有IIS服务)
所需文件::
1.cscript.exe
2.adsutil.vbs(该文件在C:InetpubAdminScripts下)
已经在目标目录下创建了一个IIS的子目录
在InstallShield中的应用:
#########
LaunchAppAndWait(SUPPORTDIR^"vdir.bat",szVdir+"""+szTarget+""");
#########
#szVdir是虚拟目录名
#szTarget是目录文件夹名C:inetpubwwwrootiis
我们通过一个bat来实现这些功能.
vdir.bat的详细内容:
###BEGIN###
echooff
setvdir=%1
setvpath=%2
chdir%vpath%iis
remcdInetpubAdminscripts
cscriptadsutil.vbsdeletew3svc/1/root/%vdir%#删除已经存在的虚拟目录
cscriptadsutil.vbscreate_vdirw3svc/1/root/%vdir%#创建虚拟目录
cscriptadsutil.vbssetw3svc/1/root/%vdir%/path%vpath%#主目录路径
cscriptadsutil.vbssetw3svc/1/root/%vdir%/DefaultDoc"login.asp"#默认文档
###END###
adsutil.vbs还可以实现很多功能,大家自已去探索吧,以下是关于adsutil.vbs的帮助(英文)
================================================================================
Usage:
ADSUTIL.VBSCMD[paramparam]
Note:ADSUTILonlysupportsthe"noswitch"optionofMDUTIL
Description:
IISK2administrationutilitythatenablesthemanipulationwithADSIparameters
StandardMDUTILCommands:
adsutil.vbsGETpath-displaychosenparameter
adsutil.vbsSETpathvalue...-assignthenewvalue
adsutil.vbsENUMpath["/P"|"/A"]-enumerateallparametersforgivenpath
adsutil.vbsDELETEpath-deletegivenpathorparameter
adsutil.vbsCREATEpath[KeyType]-creategivenpathandassignsitthegivenKeyType
adsutil.vbsAPPCREATEINPROCw3svc/1/root-Createanin-procapplication
adsutil.vbsAPPCREATEOUTPROCw3svc/1/root-Createanout-procapplication
adsutil.vbsAPPCREATEPOOLPROCw3svc/1/root-Createapooled-procapplication
adsutil.vbsAPPDELETEw3svc/1/root-Deletetheapplicationifthereisone
adsutil.vbsAPPUNLOADw3svc/1/root-Unloadanapplicationfromw3svcruntimelookuptable.
adsutil.vbsAPPDISABLEw3svc/1/root-Disableanapplication-appropriateforportingtoanothermachine.
adsutil.vbsAPPENABLEw3svc/1/root-Enableanapplication-appropriateforimportingfromanothermachine.
adsutil.vbsAPPGETSTATUSw3svc/1/root-Getstatusoftheapplication
NewADSIOptions:
/P-ValidforENUMonly.Enumeratesthepathsonly(nodata)
/A-ValidforENUMonly.EnumeratesalldatathatCANbesetonthenode
KeyType-ValideforCREATEonly.AssignsthevalidKeyTypetothepath
ExtendedADSUTILCommands:
adsutil.vbsFINDpath-findthepathswhereagivenparameterisset
adsutil.vbsCREATE_VDIRpath-creategivenpathasaVirtualDirectory
adsutil.vbsCREATE_VSERVpath-creategivenpathasaVirtualServer
adsutil.vbsSTART_SERVERpath-startsthegivenwebsite
adsutil.vbsSTOP_SERVERpath-stopsthegivenwebsite
adsutil.vbsPAUSE_SERVERpath-pausesthegivenwebsite
adsutil.vbsCONTINUE_SERVERpath-continuesthegivenwebsite
Samples:
adsutil.vbsGETW3SVC/1/ServerBindings
adsutil.vbsSETW3SVC/1/ServerBindings":81:"
adsutil.vbsCREATEW3SVC/1/Root/MyVdir"IIsWebVirtualDir"
adsutil.vbsSTART_SERVERW3SVC/1
adsutil.vbsENUM/PW3SVC
ExtendedADSUTILCommands:
adsutil.vbsFINDpath-findthepathswhereagivenparameterisset
adsutil.vbsCREATE_VDIRpath-creategivenpathasaVirtualDirectory
adsutil.vbsCREATE_VSERVpath-creategivenpathasaVirtualServer
adsutil.vbsSTART_SERVERpath-startsthegivenwebsite
adsutil.vbsSTOP_SERVERpath-stopsthegivenwebsite
adsutil.vbsPAUSE_SERVERpath-pausesthegivenwebsite
adsutil.vbsCONTINUE_SERVERpath-continuesthegivenwebsite
Samples:
adsutil.vbsGETW3SVC/1/ServerBindings
adsutil.vbsSETW3SVC/1/ServerBindings":81:"
adsutil.vbsCREATEW3SVC/1/Root/MyVdir"IIsWebVirtualDir"
adsutil.vbsSTART_SERVERW3SVC/1
adsutil.vbsENUM/PW3SVC
【用VBS修改IIS Metabase 的代码】相关文章: