Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to call a batch file with parameters from qlikview

Hi All,

I need to call a batch file from qlikview script and also send 5 parameters to batch file. So can anyone send me the script .

I tried below script but didnt work .

Execute cmd.exe /C E:\Qvd to be pushed to Mysql\Textfile.bat 3313 DatamapLoad Deletemetemp;

where 3313 ,DatamapLoad and Deletemetemp are arguements to be passed to batch file .

13 Replies
Andrea_Ghirardello

Try this...

In your qv macro:

Set obj = CreateObject("WScript.Shell")

Arg0 = "first_parameter"

Arg1 = "second_parameter"

obj.Run "C:\test\Test.bat" & Arg0 & " " & Arg1



In your batch use %1 for Arg0 and %2 for Arg2

marcus_sommer

Perhaps you tries these indirectly - you could stored the parameter in a text-file and the batch-file read this file before it executed the main-tasks.

- Marcus

Not applicable
Author

Thanks Andrea for help and patience .

After inumerable trial and errors below script worked

Sub TestingV

Dim obj

Set obj = CreateObject("WScript.Shell")

obj.Run "E:\Qlikview\Test\textfile.bat "&"locationmaster" &" CramerB" &" 3326", , TRUE

End Sub

Not applicable
Author

Hi All,

I am also stuck in similar requirement.

I have chart with link , when users click link , batch file needs to be triggered & pass values from Qlikview. This batch file is basically gonna open another app with the parameters passed from QV.

Format is

'\\server\xyz.bat' -ab <Values from QV>  -cd <Values from QV> -de<values from QV>

** -ab , -cd , -de are the parameters name for bat file.

Currently i am trying to use link repsenation of chart & using <url> '\\server\xyz.bat'  It works fine without parameter. But as soon as i add parameter , it doesnt execute.

I am not familiar with macro coding. So if you can send me step by step instructions or way to do without macro it will really help!!

Appreciate your response !!

Thanks