28

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. )
stimpy77
  • 459
  • 1
  • 5
  • 12
  • *Note*: If you get the error `ERROR ( message:The WAS service is not available - try starting the service first.)`, you'll [need to re-open with Administrative Privileges](http://sharepointwings.blogspot.com/2012/11/appcmd-error-messagethe-was-service-is.html) – KyleMit Aug 07 '15 at 13:21
  • 1
    @KyleMit you also get this message if WAS has not been started, in which case you need to start WAS using `net start was`. – Professor of programming Aug 30 '19 at 09:55
  • This is a little random (and 10 years late), but if you're trying to stop/start the App Pool back to back... you can `appcmd recycle apppool /apppool.Name:"My App Services"` instead. – Michael Jun 23 '20 at 21:24

4 Answers4

41

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

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

%SYSTEMROOT%\System32\inetsrv\appcmd stop apppool /apppool.name:"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.

mfinni
  • 36,144
  • 4
  • 53
  • 86
  • 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
8

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.
umbyersw
  • 181
  • 1
2

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

Paul
  • 1,857
  • 1
  • 11
  • 15
Kumar
  • 29
  • 1
1

in new versions of IIS you should pass apppool and site name in below format:

%systemroot%\system32\inetsrv\appcmd stop site "app_name"
%systemroot%\system32\inetsrv\appcmd stop apppool "apppool_name"

// update website's files

%systemroot%\system32\inetsrv\appcmd start apppool "apppool_name"
%systemroot%\system32\inetsrv\appcmd start site "app_name"
Paul
  • 3,037
  • 6
  • 27
  • 40
PurTahan
  • 111
  • 3