iis - IIS6 bat file - Home Directory -


how root/home directory of website in iis6 using batch file??

my scenario:

i creating tool summarise , report of sites in iis. using batch files , running iisweb /query sites looping on results , using iisvdir /query "website name" virtual directories.

however has backwards compatible iis6 , having trouble getting home directory of site.

i don't think can directly batch file, should able vbscript can call batch file.

the trick use iis wmi provider gives access iis metabase. example, script below should echo name , path of every virtual directory on local server.

set provider = getobject("winmgmts://localhost/root/microsoftiisv2")  set results = provider.execquery("select name,path iiswebvirtualdirsetting") each item in results   wscript.echo item.name   wscript.echo item.path next 

if saved script iispaths.vbs (just example), call batch file with:

cscript //nologo iispaths.vbs 

unfortunately don't have access machine iis6, unable test @ moment, if have problems getting work, feel free let me know in comments , i'll best fix issue.


Comments