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: 
Not applicable

Running password protected qvw file through batch file

Hi Everyone,

Hope all is well.

I have a simple enquiry and would like to seek your help. I have a password protected qvw file and would like to reload it automatically at given times using windows task scheduler. I crafted a simple batch script for "non-password protected" qvw file and it works perfect as intended. However, I could not solve the puzzle for running a password protected qvw through batch file. Any suggestions or recommendations will be greatly appreciated.

Let me share with you the script I crafted (this is working for non-password protected qvw):

"C:\Program Files (x86)\QlikView\qv.exe"  /r  E:\Stats\Stats.qvw

And the password protected qvw I would like to run through batch has access control in the script as per following:

SECTION Access;

LOAD [USERID],

     [PASSWORD],

     [ACCESS],

      EMP_GROUP

FROM

Users_20110921.xlsx

(ooxml, embedded labels, table is Main);

LOAD EMP_GROUP,

     DEFINEDREGION,

     FILTER

FROM

Users_20110921.xlsx

(ooxml, embedded labels, table is Zones);

SECTION Application;

STAR is All;

LOAD EMP_GROUP,

      DEFINEDREGION,

      FILTER

    

FROM

Users_20110921.xlsx

(ooxml, embedded labels, table is Zones);

Assume that UserID:admin and Password : 1234

Best,

piroglu1907

6 Replies
Anonymous
Not applicable
Author

Add one more field in Section Access - SERIAL - and the value of this filed will be the the serial number of your license.  Reload.  After this, it doesn't need userid/password on your machine.

Regards,
Michael

Not applicable
Author

Hi Michael,

Thanks for your prompt reply. I added SERIAL column into the excel sheet and inserted in the serial number to this column. Additionally, I inserted the field [SERIAL] into the section access in the script as well. However, my document is locked after reload. It does not even prompt for userid and password anymore as well.

Did I miss anything? What are your thoughts?

Best,

piroglu1907

Anonymous
Not applicable
Author

Probably you didn't miss anything - but you could mistype the serial value.  Besides, when load into Section Access from Excel (or a database), use uppper() function:

upper(USERID) as USERID,

upper(SERIAL) as SERIAL

Regards,

Michael

Not applicable
Author

Hi Michael,

It did not work again. Let me check with you something: Do I have to use Windows NT name inside the excel table Section Access is referring to? Presently, qvw has an admin user who has admin rights and this ID is not the same with Windows NT username. Could this be the problem?

Secondly, serial number I obtained from our QV SBE is 16 digits number only (separated in groups of 4 digits followed by a space like: 1234 1234 1234 1234). I tried with and without space, still cannot use. Once qvw document is reloaded, I cannot open it anymore - it does not even ask for UserID and Password.

Is there a way that I could incorporate qvw's UserID and Password into the batch script?

Thanks so much for your time and effort assisting my matter.

Best,

piroglu1907

Anonymous
Not applicable
Author

Hi

You can try doing the following:

SECTION Access;

LOAD USERID,

     PASSWORD,

     ACCESS,

     EMP_GROUP,

     '*' as NTNAME

FROM

[New Microsoft Office Excel Worksheet (2).xlsx]

(ooxml, embedded labels, table is Main);

Concatenate

LOAD USERID, PASSWORD, ACCESS, EMP_GROUP, upper(OSUser()) as NTNAME INLINE [

    USERID, PASSWORD, ACCESS, EMP_GROUP

    *, *, ADMIN, *

];

SECTION Application;

LOAD EMP_GROUP,

     DEFINEDREGION,

     FILTER

FROM

[New Microsoft Office Excel Worksheet (2).xlsx]

(ooxml, embedded labels, table is Zones);

Essentially, this adds the machine the reload is being performed from (presumably admin server) to the list of users, identifiable by the domain username. A few caveats:

1. You must open and reload the QVW on the admin machine manually at least once. This way it adds the admin user to the QVW.

2. Choose your admin machine as you will have to stick to it for this solution to work. Meaning, this will not work on any other machine unless manually reloaded first, again.

Hope this helps

P.S. admin user: admin    password: 1234

Anonymous
Not applicable
Author

Section Access with SERIAL works only if it is the Serial number of your QV Desktop license.  Serial from QV Server can't be used here.

But, if you have server, there is no need to use batch for reload - use QVS reload, where you can enter user id and password in the settings.

Regards,

Michael