How to Run IIS Express from the Command Line?

0
13788

If you want to run the site using IIS Express command line, you should install Windows 7 or newer release and IIS Express first. Then follow the steps below to do that.

1. Open a command prompt.

2. Find the IIS Express installation folder by run the command below:

Run IIS Express from the command line-1

Execute this command if you use a 64-bit OS:

Run IIS Express from the command line-2

3. View the usage string of IIS Express by running the command below:

<code>

4. Now select /config to run your site from a configuration file or use /path to run your site from the application folder. Note that you cannot combine the 2 options.

  • Run Your Site from a Configuration File

This configuration file is placed in the %userprofile%\Documents\IISExpress\config directory or %userprofile%\My Documents\IISExpress\config directory. This depends on which Operating System you use. You are free to choose run any site you want when you run a site from a configuration file.

Execute the following command to run the “Website1” in the default .config file.

Run IIS Express from the command line-3

Execute the command “iisexpress” to run the first website in the default .config file. However, if you want to run the first website in a custom .config file, you need to execute the command below.

Run IIS Express from the command line-4

Execute the command below to run a site named MyBlog from a custom .config file.

Run IIS Express from the command line-5

  • Run Your Site from the Application Folder

You can run a site directly from a folder by usihng the /path option, no matter what kind application your site is built with, ASP.NET, static HTML, PHP, WCF, or some others. IIS Express usually run the site on http://localhost:8080/ by default. As for a managed website, like ASP.NET, IIS Express will utilize .NET 4.0. Still, you can disable these default values by using the 2 options: the /port and /clr.

5. When your site is running well, you can then manage it using the IIS Express system tray or you can also execute “/systray: false” to have the system tray disabled: