<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Executing Batch File via Macro runs only once from Browser in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Executing-Batch-File-via-Macro-runs-only-once-from-Browser/m-p/800330#M661472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings Qlikview community!&amp;nbsp; Thank you in advance for taking the time to help out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro defined that is currently associated with a Button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub testBatchFile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set WshShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp = WshShell.Run("C:\Test\test.bat", 0, true)&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contents of the Batch file (test.bat) are as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo test &amp;gt; C:\Test\test.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I access the Qlikview document via a browser and click the button, the batch file successfully executes and the file test.txt is created.&amp;nbsp; However, subsequent clicks of the button does not cause the batch file to run.&amp;nbsp; (After the first successful run of the macro with the first click, I am deleting the file.&amp;nbsp; Subsequent clicks on the button does not produce a test.txt file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, if I refresh the page or select filters, then clicking the button will execute the macro successfully.&amp;nbsp; However, subsequent clicks fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allows System Access and Allow System Access are checked in Edit Module.&amp;nbsp; Under User Preferences -&amp;gt; Security -&amp;gt; Module and Script and Confirm Launch from Macro are all checked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 17:53:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-26T17:53:19Z</dc:date>
    <item>
      <title>Executing Batch File via Macro runs only once from Browser</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-Batch-File-via-Macro-runs-only-once-from-Browser/m-p/800330#M661472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings Qlikview community!&amp;nbsp; Thank you in advance for taking the time to help out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro defined that is currently associated with a Button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub testBatchFile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set WshShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp = WshShell.Run("C:\Test\test.bat", 0, true)&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contents of the Batch file (test.bat) are as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo test &amp;gt; C:\Test\test.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I access the Qlikview document via a browser and click the button, the batch file successfully executes and the file test.txt is created.&amp;nbsp; However, subsequent clicks of the button does not cause the batch file to run.&amp;nbsp; (After the first successful run of the macro with the first click, I am deleting the file.&amp;nbsp; Subsequent clicks on the button does not produce a test.txt file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, if I refresh the page or select filters, then clicking the button will execute the macro successfully.&amp;nbsp; However, subsequent clicks fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allows System Access and Allow System Access are checked in Edit Module.&amp;nbsp; Under User Preferences -&amp;gt; Security -&amp;gt; Module and Script and Confirm Launch from Macro are all checked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 17:53:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-Batch-File-via-Macro-runs-only-once-from-Browser/m-p/800330#M661472</guid>
      <dc:creator />
      <dc:date>2015-03-26T17:53:19Z</dc:date>
    </item>
  </channel>
</rss>

