How do you start/stop IIS 7 app pool from cmd line if there are spaces in the app pool name?

Solution 1:

Type appcmd list apppool, and use exactly what it lists there in your appcmd start apppool /

Names with spaces should be escaped with double quotes. For example:

%SYSTEMROOT%\System32\inetsrv\appcmd stop apppool /"My App Services"

Post the exact command you're trying to run ; perhaps you missed the colon or there's another problem with the syntax?

Edit - you're adding a space between the colon and the first double-quote. Remove that space, use the double-quote, and see what happens.

Solution 2:

The quotation marks do seem to work, however it's the space after the colon that seems to be the issue (as noted by mfinni). Here are some samples and their outputs:

c:\Windows\System32\inetsrv>appcmd start apppool / "Classic .NET AppPool"
ERROR ( message:The attribute "" is not supported in the current command usage. )

c:\Windows\System32\inetsrv>appcmd start apppool /"Classic .NET AppPool"
"Classic .NET AppPool" successfully started.



Iis 7