<?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 Execute batch file with input defined by variable from script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326504#M410299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to launch a bat file from my load script using the &lt;EM&gt;execute&lt;/EM&gt; command. Problems rise when I try to add some input defined by a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write in my qlikview load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;execute "path to my -bat file" $(input_variable);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;EM&gt;input_variable&lt;/EM&gt; contains three inputs separated by a space, e.g &lt;EM&gt;input variable = 1 2 3&lt;/EM&gt;. For some reason the input defined by the variable is not passed on to the .bat file. If instead I write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;execute "path to my -bat file" 1 2 3;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my .bat file correctly takes the input 1 2 3. So it seems that I can't define it by a variable which is a problem as I would like to define it dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody tell me what I am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 May 2017 07:43:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-05-24T07:43:30Z</dc:date>
    <item>
      <title>Execute batch file with input defined by variable from script</title>
      <link>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326504#M410299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to launch a bat file from my load script using the &lt;EM&gt;execute&lt;/EM&gt; command. Problems rise when I try to add some input defined by a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write in my qlikview load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;execute "path to my -bat file" $(input_variable);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;EM&gt;input_variable&lt;/EM&gt; contains three inputs separated by a space, e.g &lt;EM&gt;input variable = 1 2 3&lt;/EM&gt;. For some reason the input defined by the variable is not passed on to the .bat file. If instead I write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;execute "path to my -bat file" 1 2 3;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my .bat file correctly takes the input 1 2 3. So it seems that I can't define it by a variable which is a problem as I would like to define it dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody tell me what I am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 07:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326504#M410299</guid>
      <dc:creator />
      <dc:date>2017-05-24T07:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Execute batch file with input defined by variable from script</title>
      <link>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326505#M410300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to change the variable on the BAT file that needs to be executed, you need to write a Macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute Command:&lt;/P&gt;&lt;P&gt;EXECUTE cmd.exe /C C:\QVD\test.bat;&lt;/P&gt;&lt;P&gt;EXIT SCRIPT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;SUB BatTest&lt;/P&gt;&lt;P&gt;SET d = ActiveDocument.Variables("vTest")&lt;/P&gt;&lt;P&gt;&amp;nbsp; vTest = d.GetContent.STRING&lt;/P&gt;&lt;P&gt;Set obj = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;obj.Run "C:\QVD\test.bat "&amp;amp;vTest, , TRUE&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---vTest is a variable with whatever number I need to populate, example, 1, 2, 3, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My BAT File:&lt;/P&gt;&lt;P&gt;"c:\Program Files (x86)\qlikView\QV.exe" /VvReloadMacro=&lt;STRONG&gt;%1&lt;/STRONG&gt; /NoSecurity "C:\QVD\Test.qvw"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Use the %1 where you want to have your variable be pushed to..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can have any amount of variables, in your macro you can change the following:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SUB BatTest&lt;/P&gt;&lt;P&gt;SET d = ActiveDocument.Variables("vTest")&lt;/P&gt;&lt;P&gt;&amp;nbsp; vTest = d.GetContent.STRING&lt;/P&gt;&lt;P&gt;Set obj = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;obj.Run "C:\QVD\test.bat "&amp;amp;vTest&amp;amp;" 20", , TRUE&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;End Sub&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;And your BAT file:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;"c:\Program Files (x86)\qlikView\QV.exe" /VvReloadMacro=&lt;STRONG&gt;%1&lt;/STRONG&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;/VvReloadMacro2=&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;%2 &lt;/STRONG&gt;&lt;/SPAN&gt;/NoSecurity "C:\QVD\Test.qvw"&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Please ensure that the variables exist &lt;SPAN style="font-size: 13.3333px;"&gt;vReloadMacro &amp;amp; &lt;SPAN style="font-size: 13.3333px;"&gt;vReloadMacro2 in your document.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ETC...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 10:40:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326505#M410300</guid>
      <dc:creator>goro2010</dc:creator>
      <dc:date>2017-05-24T10:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Execute batch file with input defined by variable from script</title>
      <link>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326506#M410301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works when I set the variable (&lt;EM&gt;input_variable = 1 2 3&lt;/EM&gt;) with a button clik front end and then initiate a reload with another button. This is the solution I'll go with. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 07:37:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326506#M410301</guid>
      <dc:creator />
      <dc:date>2017-05-30T07:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Execute batch file with input defined by variable from script</title>
      <link>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326507#M410302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your time and answer. Unfortunately I did not get to test if your solution works, as I prefer not to go the 'macro-way'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 07:39:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Execute-batch-file-with-input-defined-by-variable-from-script/m-p/1326507#M410302</guid>
      <dc:creator />
      <dc:date>2017-05-30T07:39:22Z</dc:date>
    </item>
  </channel>
</rss>

