<?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 Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file in Management &amp; Governance</title>
    <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1988016#M23402</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the problems here is your batch file. A better version would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pushd %~dp0&lt;BR /&gt;copy /Y *.txt \\dc1\share\txt &lt;BR /&gt;popd&lt;BR /&gt;EXIT 0&lt;/P&gt;
&lt;P&gt;The reason is the folders when you call the file as a External Task are not as in your cmd prompt the "current working directory". So its better to use pushd to move into the folder you have the file and then start copying. You otherwise try to copy the file from C:\windows\system32 where it doesn't exist and end in the (0x1) error.&lt;/P&gt;
&lt;P&gt;This file above works as external task in two ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;simple with Path = C:\temp\test2.bat&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_0-1664785257236.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90393iF94282DB80A601D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_0-1664785257236.png" alt="Sebastian_Linser_0-1664785257236.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or a more advanced approach&lt;/P&gt;
&lt;P&gt;Path=&amp;nbsp;"C:\Windows\System32\cmd.exe"&lt;/P&gt;
&lt;P&gt;Parameters: /c start "" /b /w "C:\temp\test2.bat"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_5-1664785410294.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90398iF23CD93D44C9C5BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_5-1664785410294.png" alt="Sebastian_Linser_5-1664785410294.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can try the same in a Scheduled task in Windows&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_6-1664785891064.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90399i6998F029906C63C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_6-1664785891064.png" alt="Sebastian_Linser_6-1664785891064.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best regards&lt;/P&gt;
&lt;P&gt;Sebastian&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2022 08:07:50 GMT</pubDate>
    <dc:creator>Sebastian_Linser</dc:creator>
    <dc:date>2022-10-04T08:07:50Z</dc:date>
    <item>
      <title>Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1932464#M22190</link>
      <description>&lt;P&gt;I was trying to get the external program task running with a simple .bat file that copies a file to another location. The bat file works when I doubleclick it on the server. It's in a folder the service user can reach&lt;/P&gt;
&lt;P&gt;Code in bat file: "COPY Dataset_QS.txt "\\servername\Dataset\" /y"&lt;/P&gt;
&lt;P&gt;I have tried a couple of things but can't get it to work. Maybe someone can help.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Tried to put the script in the Path without any parameters&lt;/LI&gt;
&lt;LI&gt;Tried to put the cmd.exe into the Path and the script location in the parameters&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;That both doesn't work. I have also read the information on help.qlik.com about it but that doesn't really help at all.&lt;/P&gt;
&lt;P&gt;I get a error message with only a 1. Can't find anything about that online so here I am.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 12:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1932464#M22190</guid>
      <dc:creator>lauranvh</dc:creator>
      <dc:date>2022-05-18T12:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1932936#M22216</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;you should refer to these articles you need to make sure that you include the exit status&amp;nbsp;&lt;SPAN&gt;values for the task as explained in the second article.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/Qlik-Sense-Create-an-external-program-running-a-Powershell/ta-p/1713044" target="_self"&gt;Qlik-Sense-Createan external program running a Powershell&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/How-to-handle-tasks-reporting-wrong-status-when-executing/ta-p/1775681" target="_self"&gt;How-to-handle-tasks-reporting-wrong-status-when-executing&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 09:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1932936#M22216</guid>
      <dc:creator>Eugene_Sleator</dc:creator>
      <dc:date>2022-05-19T09:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933010#M22217</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've run a couple of tests and have managed to get this to work in my example to copy a .txt from one server to another shared folder:&lt;/P&gt;
&lt;P&gt;You're almost there in your example but try changing these two things:&lt;/P&gt;
&lt;P&gt;1. Including the full servername (a windows shared path) to the .bat in the &lt;STRONG&gt;Path&lt;/STRONG&gt; field&lt;/P&gt;
&lt;P&gt;2. Use the EXECUTE command in the &lt;STRONG&gt;Parameter&amp;nbsp;&lt;/STRONG&gt;field before the .bat filename:&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Path:&lt;/STRONG&gt;&amp;nbsp; \\SERVERNAME\etc...\test.bat&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Parameter:&lt;/STRONG&gt; EXECUTE test.bat&lt;/P&gt;
&lt;P&gt;Also note the source and destination folders/path specified above for the .txt files were created as Windows shared folders to make sure they are assessible with the appropriate user permissions (and including the Qlik Sense service account that is running the Sense services as this will need access to them).&lt;/P&gt;
&lt;P&gt;FYI this post shows how the same EXECUTE command was used in a Sense script therefore applying similar logic there for this as an external task. &lt;A href="https://community.qlik.com/t5/Integration-Extension-APIs/Want-to-Execute-Bat-in-load-Script-in-Qlik-sense/td-p/1220553" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Integration-Extension-APIs/Want-to-Execute-Bat-in-load-Script-in-Qlik-sense/td-p/1220553&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope that helps you get it working!&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 09:06:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933010#M22217</guid>
      <dc:creator>Jon_B</dc:creator>
      <dc:date>2022-05-20T09:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933100#M22218</link>
      <description>&lt;P&gt;Thank you for the replies.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/37611"&gt;@Jon_B&lt;/a&gt;&amp;nbsp;I have tried your solution but I can still not get this to work. I am certain that the serviceaccount can reach the file and the destination.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried both Parameter with "file" at the end and without the "file". I don't think that should be there but I tested that still.&lt;/P&gt;
&lt;P&gt;I still get the error with exit code 1.&lt;/P&gt;
&lt;P&gt;Any ideas on what I can try?&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 13:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933100#M22218</guid>
      <dc:creator>lauranvh</dc:creator>
      <dc:date>2022-05-19T13:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933428#M22222</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes sorry the "file" on the end of the Parameter field was a&amp;nbsp; mistype.&lt;/P&gt;
&lt;P&gt;I've attached a screenshot of what works for me (noting that the folder paths are shared as windows shares)&lt;/P&gt;
&lt;P&gt;I think I also saw an 'exit code 1' during testing when it couldn't find the file/folders or .bat.&lt;/P&gt;
&lt;P&gt;Since it's quite a long path, have you tried a shorter path less complex path to see if that works?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExternalCopytask.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/79912i1663B8F4079C1EB6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ExternalCopytask.png" alt="ExternalCopytask.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 07:44:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933428#M22222</guid>
      <dc:creator>Jon_B</dc:creator>
      <dc:date>2022-05-20T07:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933531#M22224</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/37611"&gt;@Jon_B&lt;/a&gt;&amp;nbsp;Thank you for the last answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I fixed it now with the change in the .bat file itself. I didn't have the complete path in there only the filename. Now it runs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll accept your reply as a solution.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 11:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933531#M22224</guid>
      <dc:creator>lauranvh</dc:creator>
      <dc:date>2022-05-20T11:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933538#M22225</link>
      <description>&lt;P&gt;Thanks for the follow up&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;happy to hear I could help you out on that.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 11:10:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1933538#M22225</guid>
      <dc:creator>Jon_B</dc:creator>
      <dc:date>2022-05-20T11:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Enterprise QMC - External program task doesn't run with .bat file</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1988016#M23402</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18676"&gt;@lauranvh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the problems here is your batch file. A better version would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pushd %~dp0&lt;BR /&gt;copy /Y *.txt \\dc1\share\txt &lt;BR /&gt;popd&lt;BR /&gt;EXIT 0&lt;/P&gt;
&lt;P&gt;The reason is the folders when you call the file as a External Task are not as in your cmd prompt the "current working directory". So its better to use pushd to move into the folder you have the file and then start copying. You otherwise try to copy the file from C:\windows\system32 where it doesn't exist and end in the (0x1) error.&lt;/P&gt;
&lt;P&gt;This file above works as external task in two ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;simple with Path = C:\temp\test2.bat&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_0-1664785257236.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90393iF94282DB80A601D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_0-1664785257236.png" alt="Sebastian_Linser_0-1664785257236.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or a more advanced approach&lt;/P&gt;
&lt;P&gt;Path=&amp;nbsp;"C:\Windows\System32\cmd.exe"&lt;/P&gt;
&lt;P&gt;Parameters: /c start "" /b /w "C:\temp\test2.bat"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_5-1664785410294.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90398iF23CD93D44C9C5BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_5-1664785410294.png" alt="Sebastian_Linser_5-1664785410294.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can try the same in a Scheduled task in Windows&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sebastian_Linser_6-1664785891064.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/90399i6998F029906C63C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sebastian_Linser_6-1664785891064.png" alt="Sebastian_Linser_6-1664785891064.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best regards&lt;/P&gt;
&lt;P&gt;Sebastian&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 08:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-Sense-Enterprise-QMC-External-program-task-doesn-t-run-with/m-p/1988016#M23402</guid>
      <dc:creator>Sebastian_Linser</dc:creator>
      <dc:date>2022-10-04T08:07:50Z</dc:date>
    </item>
  </channel>
</rss>

