需要在IIS中找到默认网站的主目录 [英] Need to find Default Web Site's Home Directory in IIS

查看:329
本文介绍了需要在IIS中找到默认网站的主目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的InstallShield安装程序需要在IIS默认网站的主目录中安装文件,并将其设置为默认网页.

My InstallShield installer needs to install a file in the IIS Default Web Site's Home Directory, and set it to the default web page.

不幸的是,在我们的环境中,我无法假定主目录为C:\ Inetpub \ wwwroot,但是我需要找出它的含义.

Unfortunately, in our environments, I can't assume that the home directory is C:\Inetpub\wwwroot, but I need to find out what it is.

关于如何使用脚本执行此操作的任何想法?我们需要支持XP,2003和2008.

Any idea on how I can do this with a script? We need to support XP, 2003 and 2008.

推荐答案

找到了它-简直太简单了:

Found it - it's dead simple:

Dim objIIsWebService
Set objIIsWebService = GetObject("IIS://localhost/W3SVC/1/ROOT")
wscript.echo objIIsWebService.Path

我知道必须有一个简单的方法!

I knew there had to be an easy way!

这篇关于需要在IIS中找到默认网站的主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆