Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Run cmd file in Windows task scheduler in Qlikview server

Hi,

I have a c# code that opens a qvw document and sends mail based on the document data.

I need it to be sent once a day, so I wrote a cmd file that works perfectly if I press on it.

The problem starts when I'm putting it in Windows task scheduler - it's not doing anything, and it seems to me it's getting stuck while trying opening Qlikview.

What am I doing wrong?

Is there another way of scheduling the execution of a batch file in BI server?

Thanks.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Linoy,

it is possible to open a QVW document from a Windows Scheduler Task. The problem is a tricky one, and various discussions on the community point in this direction: QlikView Desktop needs an UI and that is incompatible with batch execution (e.g. execution in the background without UI)

Your experiment with selecting option "Run only when user is logged on" clearly points in the same direction. Being logged on means that a "terminal" is available, even though QlikView doesn't need it in order to just execute some macros or access a bit of data.

Note that reloading a document will probably work OK without User Interface. I suspect this is because QlikView disables interactive mode when reloading / executing the load script via the command line.

View solution in original post

23 Replies
ashfaq_haseeb
Champion III
Champion III

Hi try with Python

Regards

ASHFAQ

Peter_Cammaert
Partner - Champion III
Partner - Champion III

QlikView documents can only be opened if QlikView Desktop runs under an account with a QlikView license. Change the Scheduler task to include a login as a user with a Named CAL.

Best,

Peter

linoyel
Specialist
Specialist
Author

Hi Peter, I do run the task with my own user that has the developer CAL.

I's not the license issue...

I'm suspecting that it's not possible to open a qwd document in BI server, but from QMC only.

And it's not good for me cause I don't have to reload this document but just to open it and send a mail (C# code does it all).

**In QMC I can only reload documents, right? I can't run a batch file from it?

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Are you using mapped drives, such as a Y: drive for a network share? These mapped drives are created when you login interactively, and do not exist in the context of a task running in the scheduler. Expand these drives to the full network address instead.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
mseeck75
Partner - Contributor III
Partner - Contributor III

Hi Linoy,

a reload will also work from a batch. Here is an example from my test script:

cd "C:\Program Files\QlikView\Distribution Service"

QVDistributionService.exe -r="C:\QvStorage\Private Data\Test\Apps\TechnicalModell@Test.qvw" -out="C:\QvStorage\Private Data\test\Apps\Logs"

echo Error Code: %errorlevel%

But because a reload is not the main problem for you, it will not really help you.

Do you have an installed Qv client on your BI server?

BR

Matthias

linoyel
Specialist
Specialist
Author

Hey Jonathan,

In Task Scheduler --> Actions I have an action "Start a program",

Details: "E:\QLIKVIEW\Documents\Marketing Report by mail\SendEmail.cmd"

and the cmd itself looks like this:

"\\bi-srv\E$\QLIKVIEW\Documents\Marketing Report by mail\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe"

**bi-srv is the Qlikview server

What do I have to fix here?

linoyel
Specialist
Specialist
Author

Hi Mattias,

Sorry for misleading - BI server is actually a Qlikview server.

jerrysvensson
Partner - Specialist II
Partner - Specialist II

It could be a problem with priviligies on your account.

We have seen exactly the same behaviour on our development machine. But when we run the same script on another machine with a service account that has higher priviligies than our account it works.

I would check with your IT department to see if they can help you.

linoyel
Specialist
Specialist
Author

OK, I've changed something in the Task properties in Windows scheduler:

In the General Window in security options I've changed from the option

"Run whether user is logged on or not"

to the option

"Run only when user is logged on"/

AND IT WORKED!!!

The only thing is that I'm not always logged on, why the option "Run whether user is logged on or not"  doesn't work??

Is there a way to make it work?