4

Moving on from the first issue I reported here : Running an OS command using apache-ant to IIS config

I am trying to run the second part of the IIS config.

  <exec executable="cmd.exe" dir="C:/Windows/System32/inetsrv" 
    failonerror="true">
    <arg line="/c appcmd set config /section:handlers 
 /[name=&apos;ExtensionlessUrlHandler-Integrated-
    4.0&apos;].verb:GET,POST,PUT,DELETE,OPTIONS,CONNECT"/>
    </exec>

I have no double quotes in this line, and I am using apos; to indicate my single quotes. However I'm getting the following error which Im struggling to find an explanation for :

confIIS:

[echo] Configuring IIS
[exec] ERROR ( message:Malformed collection indexer; format is 
[@position,name='value',name2='value2',...].  The @position specifier is 
optional, and be '@start', '@end', or
@N' where N is a numeric index into the collection. )

quick Update : I've tried dbl quotes but no luck. I've done some more digging and the issue is that the single quotes are being dropped. If I run the cmd line in the dos prompt without the single quotes it fails in the same way. cmd line :

appcmd set config /section:handlers  /[name='ExtensionlessUrlHandler-
Integrated-4.0'].verb:GET

Ant script (debug) output

[exec] 'appcmd'
[exec] 'set'
[exec] 'config'
[exec] '/section:handlers'
[exec] '/[name=ExtensionlessUrlHandler-Integrated-
4.0].verb:GET,POST,PUT,DELETE,OPTIONS,CONNECT'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
ute:Java13CommandLauncher: Executing 'cmd.exe' with arguments:
dazednconfused
  • 141
  • 1
  • 5
  • 16

0 Answers0