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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Windows Environment Variable

Hi,

how can i read in a QV-Script the Windows Environment Variable like %windir%

thx

Volker

1 Solution

Accepted Solutions
biester
Specialist
Specialist

In the script you can, using GetRegistryString(), e.g.

let UserEnvVar = GetRegistryString('HKEY_CURRENT_USER\Environment\','SOMEPATH');

assignes the value of the user environment variable named SOMEPATH to the QV-Script variable UserEnvVar.

Rgds,
Joachim

View solution in original post

6 Replies
martin59
Specialist II
Specialist II

Hi,

You have "DocumentPath( )" function.

Look environmental functions in the help file (F1)

Not applicable
Author

Thanks for the quick reply!

%windir% was just an example! I want to access to user-defined variable.

I use QV 8.5 and there is not above "environmental functions" in the Help

martin59
Specialist II
Specialist II

So you can try "system functions" or simply "DocumentPath", "QVUser", "OSUser"...

Not applicable
Author

OK - so, I think there is NO chance to access to user-defined Windows - envroment variables by a QV - Skript!

What a pity!

biester
Specialist
Specialist

In the script you can, using GetRegistryString(), e.g.

let UserEnvVar = GetRegistryString('HKEY_CURRENT_USER\Environment\','SOMEPATH');

assignes the value of the user environment variable named SOMEPATH to the QV-Script variable UserEnvVar.

Rgds,
Joachim

Not applicable
Author

yes - that's it!!!

thx