Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Execution of Batch file using Macro

Hi All,

I am using a batch file to upload data to FTP location. Below code is being used in macro to run batch on click event of button. But it is not working. Same code when i put it in .vbs file and execute outside qlik it works fine. Even executing batch file manually outside qlik is also working fine. So i don't see any problem with the below code, but does it require any special permission or does any configuration to be done in qlik to work .

I expect some advise or help from experts.

Dim obj,oArgs

Set obj = CreateObject("WScript.Shell")

obj.Run "C:\ftpUpload.bat ", , TRUE

5 Replies
sujeetsingh
Master III
Master III

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

tried the same, but not working.

Also when i trigger, i am not able to hide the command prompt window.

sujeetsingh
Master III
Master III

Not sure about it may be write another macro to close it.

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Once the activity is done, window will close on its own. But i don't want even window to visible to user.

petter
Partner - Champion III
Partner - Champion III

If you use the:

obj.Run "c:\test.bat " & oArgs(0), , TRUE

You can just add the second parameters which is left empty over which specify how the Windows should be shown/hidden...

Hiding the window:

obj.Run "c:\test.bat " & oArgs(0), 0 , TRUE