How to create and reload a batch file:
- EnableBatchMode should be change to True in the QVDistributionService.exe.config file.
The file can be found in C:\Program Files\QlikView\Distribution Service\
- Create a reloading document called ReloadTest.qvw using ctrl + Q two times and save under Document folder of QlikView.
- Create the following batch file:
C:\Program Files\QlikView\Distribution Service\QVDistributionService.exe" -r="C:\ProgramData\QlikTech\Documents\ReloadTest.qvw" -out="C:\ProgramData\QlikTech\Documents\ReloadTest.log"
echo %errorlevel% > "C:\ProgramData\QlikTech\Documents\error.log
- Execute the batch file with an administrator account
! When running a batch job via the QVDistributionService.exe one might experience that it doesn't work as you need administrator rights to do this. This is specifically true for Windows Server 2008 R2 and later.
Even though you might be a member of the local administrators group, it requires elevated privileges.
There are a few ways to come around this the obstacle concerning elevated rights in Windows Server 2008 R2:
Solution 1 (easier, but lower security):
With Windows Server 2008R2, Users in Administrators group does not have same rights as the built-in Administrator account.
In order to give the same right to the other accounts in "Administrator groups" one might do this:
1.Click Start, click on Administrative Tools, click Local security Policy
2.From the Local Security Settings console tree, double-click on Local Policies, and then double-click Security Options.
3.Scroll down and double-click User Account Control: Run all administrators in Admin Approval Mode.
5.Select the Disabled option, and then click OK.
6.Close the Local Security Settings window.
Make a shortcut to the batchfile, right click and select Properties, go to the tab "Shortcut", click "Advanced" and you can choose to run the batch file as an administrator.
Add after the target file path (right click on the shortcut, Properties and the tab "Shortcut". Type in:
runas /user:REQUIREDUSERNAME /savecred
Using /savecred will make it ask for admin password on first run only.
Add the task as a scheduled task under Control Panel > Administrative Tools > Task Scheduler. When running the wizard to add a task, click "Run with highest privilegies".