Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QV-application not running properly as scheduled task on Windows Server 2008

Hello all,

We have a bit of an unorthodox setup that I've started having problems with since we upgraded from Windows Server 2003 to Windows Server 2008 some weeks ago.

I have a scheduled task that runs once per week that starts a QV-app while also giving it an input-parameter like this:

"C:\Program Files\QlikView\qv.exe" /vexParam=1 "C:\QlikView\Data\App.qvw"

What the input-parameter does is trigger a macro that uses VBA to open a hidden instance of Excel, build and save a couple of Excel-files and finally shut the QV-app down.

Under Windows Server 2003 this ran perfectly. No problems at all. But on Windows Server 2008 it will only run if I choose the option "Run only when user is logged in" and remain logged in on the server while it runs. What I want is to have it work with the option "Run whether user is logged in or not" but when I try that it behaves strangely. The QV-app starts in the background - I can't actually see it but I'm watching the processes work in Task Manager - and I can see that it starts the hidden instance of Excel and starts doing some work. A couple of minutes later, which is the point where it should be saving the first Excel-file from within the macro, the QV-app just exits and the Task Scheduler claims that "The operation ran successfully". However, no Excel-files have been created so I'm thinking the QV-app actually crashed and never told the Scheduler about it.

I'm really wracking my brain (and Google) trying to find the solution to this and I find it really odd that everything works if I just choose the "Run only when user is logged in"-option since if it was a permissions problem I'm thinking it wouldn't work that way either since either way it runs using my login and credentials.

I have very limited experience with Windows Server 2008 (basically none) so I'm pretty much at an end here and don't know where to go from here. Anybody have a clue as to what is tripping me up here? I'm really starting to get desperate.

Oh, and I'm sure there's a "better" way to do this but that is outside of the scope of this question, we're not looking to change the setup at this point. We just want it to start working again like it did before we switched servers.

1 Solution

Accepted Solutions
Not applicable
Author

It turns out most of our problems were caused by the way scheduled tasks run in Windows Server and the specifics of the running macro. The macro attempts to configure a report by manipulating the QlikView-GUI. This is not possible when a task runs "headless" without a logged in user since when no user is logged in no GUI is ever created by the OS (no "desktop-object" exists to hold GUI-components), thus the macro would fail.

View solution in original post

14 Replies
Not applicable
Author

Hi, thedanlof

please take note that '/r' option should be present in batch command to trigger reload.

"C:\Program Files\QlikView\qv.exe" /r /vexParam=1 "C:\QlikView\Data\App.qvw"

If you have Qlikview server, definitely you can schedule it on server with input parameter configured as well.

regards

mingming

Not applicable
Author

I tried adding the /r option but all that did was cause the entire job to hang, i.e. I would see the processes (qv.exe and EXCEL.EXE) pop up in the task manager, start working and the after a couple of minutes just stop and "stay put" seemingly no longer doing any work.

We have a QlikView server but I can't find the option to configure input parameters in the Management Console.

Not applicable
Author

Did you ever figure this issue out?

I've seen similar issues on our side within the past two weeks - file creation (an export/print to PDF macro) setup suddenly 'hang up' at the point where it would write the file.

I've confirmed the line directly before works fine, but the PDF generation does not.  Not exactly the same issue, but similar behavior/results.

Not applicable
Author

After trying a bunch of different things over a couple of weeks I tried a couple of things:

Running the command with, and without the /NoSecurity flag

(in your situation):

"C:\Program Files\QlikView\qv.exe" /vexParam=1 /NoSecurity "C:\QlikView\Data\App.qvw"

.. and also, I tried kicking the job off (while configured to run as '... whether logged in or not') as another user who is setup as an admin on that same system.

After doing this, for some bizarre reason, the job runs fine again as the intended user, and whether they are logged in or not.

No idea why or how, but this resolved my issue.

Not applicable
Author

It turns out most of our problems were caused by the way scheduled tasks run in Windows Server and the specifics of the running macro. The macro attempts to configure a report by manipulating the QlikView-GUI. This is not possible when a task runs "headless" without a logged in user since when no user is logged in no GUI is ever created by the OS (no "desktop-object" exists to hold GUI-components), thus the macro would fail.

Not applicable
Author

I had the same problem with my migration, the problem come from Office and not from Qlikview

To work, Office needs a Desktop folder (why? ... good question!).

And on Windows 2008 there is no Desktop folder if you are not logged in, so you have just to create one and it will work fine !

- Windows 2008 Server x64

      Please make this folder.

      C:\Windows\SysWOW64\config\systemprofile\Desktop

- Windows 2008 Server x86

      Please make this folder.

      C:\Windows\System32\config\systemprofile\Desktop

Next, to run the macro I use this command: qv.exe /vParam=1 /NoSecurity App.qvw

But I don't know if the /NoSecurity flag is really usefull

dasilva
Partner - Contributor III
Partner - Contributor III

Thank you!! Adding the folder solved the problem! Thanks

Anonymous
Not applicable
Author

davidbertet wrote:

- Windows 2008 Server x64

      Please make this folder.

      C:\Windows\SysWOW64\config\systemprofile\Desktop

- Windows 2008 Server x86

      Please make this folder.

      C:\Windows\System32\config\systemprofile\Desktop

Hi, FYI, on Windows 2008 R2 it seems you have to add both these folders!

Not applicable
Author

This is a well-documented issue in Windows Server 2008......

But, despite suggestions in the many threads out there, I still can't get Windows Scheduler to run a bacth file which opens a qvw with an OnOpen trigger to run a macro using "run whether user is logged on or not". If a user has to be logged on for it to work, it's quite useless!

I'm sure other QV developers have encountered this issue - there's plenty of threads on the forum discussing using a batch file to trigger a macro - so, please could someone using Windows Server 2008 advise on how to configure the task, qvw, macro etc. to make it work?

Just to confirm, manually opening the batch file triggers the macro correctly.

Thanks in advance.