Previous Next

Thread: Using appcmd with arguments with spaces in them

Last post 05-11-2008 9:19 PM by metrik. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 05-11-2008, 5:20 AM

    • metrik
    • Not Ranked
    • Joined on 05-03-2008, 3:37 AM
    • Posts 3

    Using appcmd with arguments with spaces in them

    Using the configuration tool I got the command I should run being:

    appcmd.exe set config  -section:system.applicationHost

    /sites /[name='Default Web Site'].[path='/'].applicationPool:"Test App Pool"  /commit:apphost
     
    However it returns an error of:
     
     Failed to process input: The parameter 'Site'].[path='/'].applicationP
    ool:Test App Pool' must begin with a / or - (HRESULT=80070057).
     
    Any ideas? 
  • 05-11-2008, 10:16 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 1,090

    Re: Using appcmd with arguments with spaces in them

    Double quotes are needed ("") around any argument with spaces in it - the tool did it for the application pool name but not the we site name - I will verify on monday whether this is fixed for upcoming tech preview.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-11-2008, 9:19 PM In reply to

    • metrik
    • Not Ranked
    • Joined on 05-03-2008, 3:37 AM
    • Posts 3

    Re: Using appcmd with arguments with spaces in them

    appcmd.exe set config  -section:system.applicationHost

    /sites /[name="Default Web Site"].[path='/'].applicationPool:"Test App Pool"  /commit:apphost
     
    returns:
     
    ERROR ( message:Cannot find requested collection element. ) 
     
    If I change Default Web Site to another site without spaces say Tester it works fine.  I'll keep trying a few things and hopefully nut it out, otherwise I'll just use the site's id.
     
     Update:
     
    I was putting my double quotes around just the name not the whole parameter and it works fine now.  Thanks for your help. 
     
     
     
     
     

     

Page 1 of 1 (3 items)
Page view counter