<?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 Calling a DOS batch file from macro passing a parameter in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194559#M55407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Question: will the call to the batch command in Qv script help?&lt;/P&gt;&lt;P&gt;It will be much easier to call batch with parameter in QV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Sep 2009 11:09:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-09-23T11:09:51Z</dc:date>
    <item>
      <title>Calling a DOS batch file from macro passing a parameter</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194556#M55404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone suggest a method whereby I can call a dos batch file with a parameter from a macro?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 18:55:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194556#M55404</guid>
      <dc:creator>bismart</dc:creator>
      <dc:date>2009-09-22T18:55:11Z</dc:date>
    </item>
    <item>
      <title>Calling a DOS batch file from macro passing a parameter</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194557#M55405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, this is a tricky one. You can use a QlikView trigger to execute an external file. You may get a prompt if you're not overriding Launch security (Security tab of User Preferences).&lt;/P&gt;&lt;P&gt;I tried setting this up with a simple bat file, but QlikView does not seem to be passing the parameters correctly to that file. I also tried creating a Wscript Shell inside a macro, but QlikView doesn't seem to allow that. I created a separate vbs (VBScript) file and that allowed me to create the shell. With the vbs, I set it up to take a parameter and then call my batch file, passing that parameter. I tried launching the vbs directly from within QlikView but it didn't work.&lt;/P&gt;&lt;P&gt;I finally came up with a solution and it seems to be a lot of work:&lt;BR /&gt; 1. Create your batch file as normal to take a parameter. For my testing, I used:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;@echo %1&lt;BR /&gt;pause&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt; 2. Create a vbs file which takes a parameter and runs the batch file using the parameter. I used: &lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Dim obj&lt;BR /&gt;Set obj = CreateObject("WScript.Shell")&lt;BR /&gt;Set oArgs = wscript.Arguments&lt;BR /&gt;obj.Run "c:\test.bat " &amp;amp; oArgs(0), , TRUE&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt; 3. In QlikView, set up your trigger to launch the vbs file. I used a button. Since I couldn't get the Trigger to work for the bat or vbs, I used cscript*. &lt;BR /&gt; Actions: Launch&lt;BR /&gt; Application: cscript&lt;BR /&gt; Filename: c:\test.vbs fun&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That Trigger should pass the parameter, fun, to the vbs file, which will pass the parameter to the batch file and execute. Note: You can make the Filename an expression if your parameter needs to be dynamic. Here's a screenshot of the Trigger using a QlikView variable, vParam, for the parameter:&lt;BR /&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/8867.ex_5F00_trigger.PNG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x538/__key/CommunityServer.Discussions.Components.Files/11/8867.ex_5F00_trigger.PNG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;* Cscript info from Microsoft: &lt;A href="http://technet.microsoft.com/en-us/library/bb490816.aspx"&gt;http://technet.microsoft.com/en-us/library/bb490816.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 21:31:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194557#M55405</guid>
      <dc:creator />
      <dc:date>2009-09-22T21:31:52Z</dc:date>
    </item>
    <item>
      <title>Calling a DOS batch file from macro passing a parameter</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194558#M55406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that comprehensive answer. Much appreciated.&lt;/P&gt;&lt;P&gt;Will try it tomorrow and let you know how I got on.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2009 22:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194558#M55406</guid>
      <dc:creator>bismart</dc:creator>
      <dc:date>2009-09-22T22:30:49Z</dc:date>
    </item>
    <item>
      <title>Calling a DOS batch file from macro passing a parameter</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194559#M55407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Question: will the call to the batch command in Qv script help?&lt;/P&gt;&lt;P&gt;It will be much easier to call batch with parameter in QV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Sep 2009 11:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-DOS-batch-file-from-macro-passing-a-parameter/m-p/194559#M55407</guid>
      <dc:creator />
      <dc:date>2009-09-23T11:09:51Z</dc:date>
    </item>
  </channel>
</rss>

