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

<返回列表

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

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

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

1.打开命令提示符

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

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

cd \Program Files\IIS 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 IISExpress8\config\applicationhost.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:\myconfig\applicationhost.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 山东联通免备案) 
分享新闻到:

更多帮助

关于网站备案的常见问题

新闻中心 2025-01-12
网站备案是加强和规范互联网网站管理推动互联网健康发展的重要举措 1、什么是网站备案?...
查看全文

一个国际网站需要多少个海外服务器来搭

新闻中心 2025-01-11
一个国际网站需要多少个海外服务器来搭建运营?这个问题不是很好回答,因为影响国际网站...
查看全文

域名被墙和域名DNS污染的区别是什么?

新闻中心 2025-01-11
域名被墙是什么? 域名被墙是指被(Great Firewall以下简称GFW)也称中国防火墙或中国国家防火...
查看全文