如何从命令行运行IIS的方法 iis命令行打开

<返回列表

如何从命令行运行IIS的方法 iis命令行打开

今天小编特意整理了一些从命令行运行IIS Express的方法,前提是服务器安装Windows 7或更高版本以及IIS Express。

从命令行使用IIS Express运行站点

1.打开命令提示符

您无需管理员用户权限即可运行本演练中的命令。但是,如果要在编号为1024或更小的端口上运行IIS Express,则必须具有管理员用户权限。

2.运行以下命令以导航到IIS Express安装文件夹:

cd Program FilesIIS Express

或者如果您使用的是64位操作系统,请运行以下命令:

cd Program Files (x86)IIS Express

3.运行以下命令以查看IIS Express用法字符串:

iisexpress /?

IIS Express Usage:

------------------

iisexpress [/config:config-file] [/site:site-name] [/siteid:site-id] [/systray:boolean]

iisexpress /path:app-path [/port:port-number] [/clr:clr-version] [/systray:boolean]

/config:config-file

The full path to the applicationhost.config file. The default value is the IISExpress8configapplicationhost.config file that is located in the user's Documents folder.

/site:site-name

The name of the site to launch, as described in the applicationhost.config file.

/siteid:site-id

The ID of the site to launch, as described in the applicationhost.config file.

/path:app-path

The full physical path of the application to run. You cannot combine this option with the /config and related options.

/port:port-number

The port to which the application will bind. The default value is 8080. You must also specify the /path option.

/clr:clr-version The .NET Framework version (e.g. v2.0) to use to run the application. The default value is v4.0. You must also specify the /path option.

/systray:boolean

Enables or disables the system tray application. The default value is true.

/trace:debug-trace-level

Valid values are info or i,warning or w,error or e.

Examples:

iisexpress /site:WebSite1

This command runs WebSite1 site from the user profile configuration file.

iisexpress /config:c:myconfigapplicationhost.config

This command runs the first site in the specified configuration file.

iisexpress /path:c:myapp /port:80

This command runs the site from c:myapp folder over port 80.

4.使用以下方法之一运行您的站点:

使用/ config从配置文件运行站点。

有关详细信息,请参阅“从配置文件运行站点”。

使用/ path从应用程序文件夹运行站点。

有关详细信息,请参阅“从应用程序文件夹运行站点”。

注意:无法组合/ path选项和/ config选项。

5.站点运行后,您可以使用IIS Express系统托盘进行管理。有关更多信息,请参阅使用Windows系统托盘管理网站和应用程序。或者,您可以通过运行以下选项来禁用系统托盘:

/systray:false

打开IIS配置窗口的CMD命令:开始---运行---CMD----输入inetmgr
直接使用CMD我们可以操作很多事情,比如启动IIS,重启IIS,停止IIS



重启IIS服务器,开始->运行->cmd (以下列出相关操作命令):

IISBOY网,IISBOY.COM

iisreset /RESTART 停止后启动
iisreset /START 启动IIS (如果停止)



iisreset /STOP 停止IIS (如果启动)
iisreset /REBOOT 重启电脑

iisreset /REBOOTonERROR 如果停止IIS失败重启电脑


iisreset /NOFORCE 不用强迫IIS停止

iisreset /TIMEOUT:X 在X秒后,IIS被强制停止,除非 /NOFORCE 参数给出. 内容来自

最方便的使用,当然你也可在CMD下运行:iisreset /start

国内免备案VPS301跳转服务器国内免备案服务器域名被墙跳转301,绕过信息安全中心不能放违反法律法规内容!(北京免备案镇江免备案江苏免备案辽宁免备案vps山东联通免备案
分享新闻到:

更多帮助

告别繁琐备案BC国内免备案服务器助您轻松搭建网站

新闻中心 2026-04-11
曾几何时,想要搭建个人或企业网站,很多人都被复杂的备案流程所困扰。资料的准备、反复的审核、漫长的等待周期,对于初创团队或个人站长来说,往往让激情与思路被耗损在流···
查看全文

2026年最新国内免备案虚拟空间推荐与使用攻略

新闻中心 2026-04-11
随着互联网的不断发展,越来越多的个人和企业开始关注虚拟空间的选择与使用。当网站建设变得普及且需求多样化时,免备案虚拟空间逐渐成为一类备受关注的解决方案。对于那些···
查看全文

国内免备案服务器如何实现301重定向快速提升网站访问速度

新闻中心 2026-04-10
随着互联网的普及和网站业务需求的增长,越来越多的人关注网站的访问速度与稳定性。在众多提升手段之中,通过301重定向调整网站结构及访问路径成为一种有效的方法,尤其···
查看全文
返回更多帮助