Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Klaus_Partyhaus
Contributor
Contributor

EXECUTE command not working

Dear all, 

I am struggling with the EXECUTE command in Qlik Sense for days now, I hope someone can help me. I have seen a lot of similar quenstions on this community but not always with a clear solution. 

Problem: EXECUTE command is not working in Qlik Script. 

Done so far:
1. Change the Settings.ini file and restarted the Engine Services
2. Disables Standard mode
3. Tried a lot script examples

Sometimes the script is loading succesfully but nothing is happening.
In other tries it looks like the script is doing something but it's hanging and it wil not stop. 

Final goal: I want to execute a Python script. 

What to do to get this working?

 

Labels (1)
8 Replies
NadiaB
Support
Support

Hi @Klaus_Partyhaus

 

Is this a multi-node environment? if so, does it work when it runs on specific node and fails when it goes to a different node?

Do you see any error in the script log when it fails or does the script runs successfully?

Have you seen any errors in Windows Event Viewer?

Could it be possible to share a sample of the script you are attempting to execute?

 

Thank you !

 

 

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Klaus_Partyhaus
Contributor
Contributor
Author

Hi Nadia, 

Thnx for your reply!

No, it is a single node. Having the same problem on my local environment (test) as on our server. 

 

Script error

Have seen "The handle is invalid" a few times. 

For example when trying Execute "cmd.exe /c" "start chrome";

Windows Event Viewer
Have seen following log in Windows Event Viewer restarting Engine Service:

"{Copy Moved} Unable to map an image file to the address specified in the image file. Local repairs should be performed on this copy."  Translated from Dutch

My settings.ini looks like below:

[Settings 7]
key=value
OverrideScriptSecurity=1
StandardReload=0

 


Some scripts examples i tried:

Script 1 Python

SET vPythonPath = 'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python310\\python';
SET vPythonFile = 'C:\\Qlikshare\\QLIK DWH\\Python\test.py';

Execute "$(vPythonPath)" "$(vPythonFile)";

Script 2 Python 

SET vPythonPath = 'C:\Users\\username\AppData\\Local\Programs\Python\Python310\python';
SET vPythonFile = 'C:\Qlikshare\QLIK DWH\\Python\test.py';

Execute "$(vPythonPath)" "$(vPythonFile)";

Script 3 Python

Execute cmd.exe /c "C:\Qlikshare\QLIK DWH\Python\test.py";

Script 4 Excel test

EXECUTE C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE "C:\Users\username\Desktop\Data.xlsx";

Script 5 Excel test

SET vProgramPath = 'C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE';
SET vProgramFile = 'C:\Users\username\Desktop\Data.xlsx';
Execute "$(vProgramPath)" "$(vProgramFile)";

Script 6 Starting Google CHrome

Execute cmd.exe /c "start chrome";

vish123
Creator III
Creator III

Hi Klaus,

Please try below.

Ensure you have entered new line in while saving settings.ini file

Also try restarting Qlik Services.

Can you also let me know where is your file is hosted? is it on Server ? or in your local machine?

Hope this helps.

Klaus_Partyhaus
Contributor
Contributor
Author

Hi Vish123,

Thnx for your reply!

I have checked again if there is a new white line in the settings.ini and I am sure it is in there. 

I restarted all the Qlik servers but no succes at this moment. 

At the moment I am testen at my local machine and the file is also located on the same machine in the QlikShare folder. 
I also tested it on the server where the file was also located in de server QlikShare folder.

Klaus_Partyhaus_0-1651660333614.pngKind regards, 

vish123
Creator III
Creator III

Hi Klaus,

Have you tired changing the file location to some where on server for ex: C:// drive folder.. Just check once.

Klaus_Partyhaus
Contributor
Contributor
Author

Hi Vish123,

That is not working as wel.

For the record: I can't execute any program. For instance: 

Execute C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE;

or

Execute cmd.exe /c "start chrome";

Kind regards, 

 

 

NadiaB
Support
Support

@Klaus_Partyhaus

 

Is that an error "The handle is invalid" from python or an error from Qlik script? 

Could you try to execute your python script from a windows tasks and verify the outcome?

 

Thanks!

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Klaus_Partyhaus
Contributor
Contributor
Author

@NadiaB Is it from the Qlik script. 

I executed the python script with CMD and that is working as expected. 

 

Kind regards,