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

http://technet.microsoft.com/en-us/library/cc732742(WS.10).aspx

The above URL describes how to start/stop an IIS 7 app pool. However, I have spaces in my app pool name. Double-quotes doesn't work. Ideas?

C:\Windows>C:\Windows\System32\inetsrv\appcmd stop apppool /apppool.name: My Ap
p Services
Failed to process input: The parameter 'App' must begin with a / or - (HRESULT=8
0070057).

C:\Windows>C:\Windows\System32\inetsrv\appcmd stop apppool /apppool.name: "My A
pp Services"
ERROR ( message:The attribute "apppool.name" is not supported in the current com
mand usage. )

-

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

It does look like names with spaces will be escaped with double quotes. 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.

-
This is what happens WITHOUT quotes, where the name is "My App Services": Failed to process input: The parameter 'App' must begin with a / or - (HRESULT=8 0070057). –  stimpy77 Jun 29 '10 at 18:09
And this is what happens WITH quotes for name "My App Services": ERROR ( message:The attribute "apppool.name" is not supported in the current command usage. ) –  stimpy77 Jun 29 '10 at 18:11
Stimpy - as i said, post the exact command that you're typing. - whoops - I see you edited your post to include that. Take away the initial space after the ":" –  mfinni Jun 29 '10 at 18:30
Failed to process input: The parameter 'Services' must begin with a / or - (HRESULT=80070057). –  stimpy77 Jun 29 '10 at 19:35

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 /apppool.name: "Classic .NET AppPool"
ERROR ( message:The attribute "apppool.name" is not supported in the current command usage. )

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

-

Try without space after colon
It succedded for me
Even if there is space in app pool name try it with double quotes
Sample 01: appcmd start apppool /apppool.name:"ASP.NET V2.0"
Sample 02: appcmd start apppool /apppool.name:MyAppPool

-