0

これを ant で実行したい (コマンドは cmd で直接パスした場合に機能します)

%windir%\system32\inetsrv\Appcmd set site /site.name:"Default Web Site" /+bindings.[protocol='https',bindingInformation='*:443:']

しかし、それは機能していません。問題は、私が何かをエスケープしていないことです (私の疑いは / + [ 記号です)。私はこれを試しましたが、まだ動作しません:

C:\Windows\system32\inetsrv\Appcmd set site /site.name:"Default Web Site" /+bindings.[protocol='https',bindingInformation='*:443:'] 

これはビルド スクリプトの一部です

<!-- Create the actual https binding for the Site -->
    <staf location="local"
        service="PROCESS"
        request="START COMMAND netsh http add sslcert ipport=0.0.0.0:443 certstorename=MY certhash=${local.machine.certhash} appid={${local.machine.keycontainer}} WAIT STDERRTOSTDOUT RETURNSTDOUT"
        throwBuildException="STAF ERROR" /> 

    <staf location="local"
        service="PROCESS"
        request="START  COMMAND %windir%\system32\inetsrv\Appcmd set site /site.name:&quot;Default Web Site&quot; /+bindings.[protocol=&apos;https&apos;,bindingInformation=&apos;*:443:&apos;] WAIT STDERRTOSTDOUT RETURNSTDOUT"
        throwBuildException="STAF ERROR" /> 

実行から得られるエラーは次のとおりです。

 RC=0, Result=
 [staf] {
 [staf]   Return Code: 87
 [staf]   Key        : <None>
 [staf]   Files      : [
 [staf]     {
 [staf]       Return Code: 0
 [staf]       Data       : Failed to process input: The parameter 'Site' must begin with a / or - (HRESULT=80070057).
4

1 に答える 1

0

正しくエスケープされたコマンドは次のとおりです。

<staf location="local"
                service="PROCESS"
                request="START COMMAND &quot;C:\\Windows\\system32\\inetsrv\\Appcmd set site /site.name:\&quot;Default Web Site\&quot; /+bindings.[protocol=&apos;https&apos;,bindingInformation=&apos;*:443:&apos;]&quot; WAIT STDERRTOSTDOUT RETURNSTDOUT"
                throwBuildException="STAF ERROR" />
于 2016-01-14T11:09:35.913 に答える