How do I include one environment variable inside another in the registry?

  • Thread starter Thread starter jtpryan
  • Start date Start date
J

jtpryan

I want to run a reg file that inserts an environment variable. But I
need to include within it another environment variable.

So, doing this from the command line is:

variable=this is my %system%

then %variable% is equal to "this is my systemname" where "systemname"
is the %system% variable.

This works from the command line, but not when inserted into the
registry. How would one do that?

-Jim
 
jtpryan said:
I want to run a reg file that inserts an environment variable. But I
need to include within it another environment variable.

So, doing this from the command line is:

variable=this is my %system%

then %variable% is equal to "this is my systemname" where "systemname"
is the %system% variable.

This works from the command line, but not when inserted into the
registry. How would one do that?

-Jim

AFAIK you cannot do this in the registry. If you could then
you would have to control the order in which the registry
variables are resolved, and you abviously have no control
over this. Do it in a batch file that executes at boot time
under control of the Task Scheduler.
 
Back
Top