<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Execute Action]]></title><description><![CDATA[<p dir="auto">Hello all,</p>
<p dir="auto">I am having trouble executing a batch file when using the 'Execute command on management server' action.</p>
<p dir="auto">Is it possible to execute a batch file?<br />
I would also like to pass the message, node and status variables through to the batch file.</p>
<p dir="auto">My email alerts work when they are assigned to the event policies.</p>
<p dir="auto">A test command I have tried running is - "echo test &gt;&gt; c:\test.txt"</p>
<p dir="auto">Please let me know what I am doing wrong.</p>
<p dir="auto">Thanks in advance.</p>
]]></description><link>https://forum.netxms.org/topic/320/execute-action</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:05:32 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/320.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 May 2008 07:19:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Execute Action on Thu, 01 May 2008 23:50:38 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the reply Victor,</p>
<p dir="auto">I was able to run the code you provided if I used just test.txt instead of c:\test.txt.<br />
The file then appeared in the C:\netxms\var directory.</p>
<p dir="auto">I then copied my batch file to this directory and it was able to be run using the following command - file.cmd "%m"</p>
<p dir="auto">I am running the netxms service as the local admin so I am not sure if it was a permission error?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.netxms.org/post/1556</link><guid isPermaLink="true">https://forum.netxms.org/post/1556</guid><dc:creator><![CDATA[mrballan]]></dc:creator><pubDate>Thu, 01 May 2008 23:50:38 GMT</pubDate></item><item><title><![CDATA[Reply to Execute Action on Thu, 01 May 2008 10:09:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">If you wish to execute batch file, you should run CMD.EXE explicitely. Try to use command line like</p>
<pre><code>cmd.exe /C "echo test &gt;&gt; c:\test.txt"
</code></pre>
<p dir="auto">To pass additional information to your script, you can use same macros as in alarms (%m, %n, etc.) in action's command line.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/1554</link><guid isPermaLink="true">https://forum.netxms.org/post/1554</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 01 May 2008 10:09:25 GMT</pubDate></item></channel></rss>