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

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
 
P

Pegasus \(MVP\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top