cancel
Showing results for 
Search instead for 
Did you mean: 

Defining an Environment Variable

former_member217396
Participant
0 Kudos

Hi,

I want to user the standard Windows environment variable %USERPROFILE% in PD.

How to do that, somehow it dosn't work for me ... I have tried to define it in the:

1. General Optios -> Variables as a new variable USERPROFILE

2. Use it in the Named Paths to reference f.e. extensions

Most probably the syntax I'm unsing is a wrong one ...

What's the syntax if I want to create a new variable and what's the syntax if I want to reuse one in the Named Paths .. f.e.

Name Path Comment

_ICONS is defined as %USERPROFILE%\BPM\8 Icons\

And I would assume, I can somehowe reuse the standard windows variables like USERPROFILE etc.?

Thanks,

Rafal

Accepted Solutions (0)

Answers (2)

Answers (2)

GeorgeMcGeachie
Active Contributor
0 Kudos

In PD help it says this about environment variables:

To use a variable in GTL (see Customizing and Extending PowerDesigner > Customizing Generation with GTL ), prefix it with a dollar sign, and wrap it in percent signs. For example,

%$CMD%.Does this help?

former_member217396
Participant
0 Kudos

Hi Georg,

how to use it in GTL is known... but I'm asking: how to use it in the Tools -> General Settings ...

for example, I want to define the _SHARED named path to point windows USERPROFILE ...

How to do that?

Thanks

c_baker
Employee
Employee
0 Kudos

The following GTL should work:

.vbscript

Dim wshShell

set wshShell = CreateObject("WScript.Shell")

ScriptResult=wshShell.ExpandEnvironmentStrings( "%USERPROFILE%" )

.endvbscript

You can alter as necessary into a normal VBScript or method.

You do not need to define any environment variables in PD paths.

Chris

former_member217396
Participant
0 Kudos

Anyone?