Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
sagarjagga
Contributor

Want to Execute .Bat in load Script in Qlik sense Hub

I need to execute .bat from Qliksense Hub (not qliksense desktop)

10 Replies
Luminary
Luminary

Re: Want to Execute .Bat in load Script in Qlik sense Hub

You can use the Execute statement:

https://help.qlik.com/en-US/sense/February2018/Subsystems/Hub/Content/Scripting/ScriptRegularStateme...


EDIT: To use Execute you need to switch to "Legacy mode" which is not recommended for security reasons. You really should know what you're doing here.

sagarjagga
Contributor

Re: Want to Execute .Bat in load Script in Qlik sense Hub

Thank you Juraj for your quick reply.

Can you elaborate how i can switch to legacy mode and how it hamper security

Thanks

Luminary
Luminary

Re: Want to Execute .Bat in load Script in Qlik sense Hub

Hi,

I'll start with security. Go through these links and make sure you fully understand security implications of switching to legacy mode:

https://help.qlik.com/en-US/sense/February2018/Subsystems/Hub/Content/LoadData/file-system-access-re...

https://help.qlik.com/en-US/sense/February2018/Subsystems/Hub/Content/LoadData/disable-standard-mode...

If you still think this is what you want to do, then go to QMC->Engine->Advanced and uncheck "Standard Mode".

(as described here: https://help.qlik.com/en-US/sense/February2018/Subsystems/ManagementConsole/Content/edit-engine.htm).

Juraj

sagarjagga
Contributor

Re: Want to Execute .Bat in load Script in Qlik sense Hub

Thank you again Juraj. i want to call a HTML file through qliksense. so i am thinking to execute the bat from qliksense and that bat file will help to execute the HTML.

is there any direct way to call HTML from qliksense , if not , is there anyway to call bat file from qliksense hub without hampering the security

Thanks,

Luminary
Luminary

Re: Want to Execute .Bat in load Script in Qlik sense Hub

Do you want to load data from an HTML file or open a browser and view an HTML file? If simply open a browser and view, any specific reason you need to do this from script?

sagarjagga
Contributor

Re: Want to Execute .Bat in load Script in Qlik sense Hub

i want to reload the NPrinting task after the qliksense app reload successfully. for that i will call an HTML once all the qliksense app reload successfully and then using javascript in the HTML , i will execute the NPrinting report tasks.

nprinting 17 task reload after QMC task

Luminary
Luminary

Re: Want to Execute .Bat in load Script in Qlik sense Hub

Optionally you can call NPrinting API directly from the script:

How to use Qlik NPrinting APIs inside a Qlik Sense load script

I understand you would need to upgrade the REST connector to recently released version 1.3, possibly the whole environment to Feb 2018 (not sure, did not go through all the details). This would be the safest way to do it.

sagarjagga
Contributor

Re: Want to Execute .Bat in load Script in Qlik sense Hub

i have 1.2 version of REST connector. So it may also not help

Luminary
Luminary

Re: Want to Execute .Bat in load Script in Qlik sense Hub

REST connector is available as a separate download, so you can download the most recent version from the download site.