Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot run a Windows command via Ant, but can on cmd.exe
    primarykey
    data
    text
    <p>I have an ant macro I want to run;</p> <pre><code>&lt;macrodef name="serviceTask"&gt; &lt;attribute name="server"/&gt; &lt;attribute name="operation"/&gt; &lt;attribute name="service"/&gt; &lt;sequential&gt; &lt;echo message="sc \\@{server} @{operation} @{service}"/&gt; &lt;exec executable="sc.exe" failonerror="true"&gt; &lt;arg line="\\@{server} @{operation} @{service}"/&gt; &lt;/exec&gt; &lt;/sequential&gt; &lt;/macrodef&gt; &lt;target name="startTomcat"&gt; &lt;echo message="Start Tomcat ${service} on ${server}"/&gt; &lt;serviceTask server="MyServer" operation="start" service="Tomcat8180"/&gt; &lt;/target&gt; </code></pre> <p>But I get an RPC error:</p> <pre><code>startTomcat: [echo] Start Tomcat Tomcat8180 on pacdcdtadeva02 [echo] sc \\pacdcdtadeva02 start Tomcat8180 [exec] [SC] OpenSCManager FAILED 1722: [exec] [exec] The RPC server is unavailable. [exec] stopTomcat: [echo] Stop Tomcat Service Tomcat8180 on pacdcdtadeva02 [echo] sc \\pacdcdtadeva02 stop Tomcat8180 [exec] [SC] OpenSCManager FAILED 1722: [exec] [exec] The RPC server is unavailable. [exec] [echo] ------------------------------------------------------------------- [echo] --- Completed on 02/01/2011 05:11:42 PM [echo] ------------------------------------------------------------------- </code></pre> <p>Now when I run this from the command line like</p> <pre><code>sc \\stage01 start Tomcat8180 </code></pre> <p>the service starts/stops</p> <pre><code>C:\usr\svn_workspaces\xIVR\agent-ivr&gt;sc \\stage01 start Tomcat8180 SERVICE_NAME: Tomcat8180 TYPE : 10 WIN32_OWN_PROCESS STATE : 2 START_PENDING (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x1 WAIT_HINT : 0xbb8 PID : 11228 FLAGS : </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload