Variables in Registry Keys?

K

Keith

Can I use the %username% system variable in a registry key in a .reg file?

Thanks
 
M

Mark V

In said:
Can I use the %username% system variable in a registry key in a
.reg file?

Yes but the valuename "type" must be REG_EXPAND_SZ (Expand String) in
order for the system to, well, expand the value of the named
environment variable. Otherwise it will just look like a literal "%
username%" string as in type REG_SZ.
 
M

Mark V

In said:
Can I use the %username% system variable in a registry key in a
.reg file?

Yes but the valuename "type" must be REG_EXPAND_SZ (Expand String) in
order for the system to, well, expand the value of the named
environment variable. Otherwise it will just look like a literal "%
username%" string as in type REG_SZ.
 
K

Keith

Thank you

Mark V said:
Yes but the valuename "type" must be REG_EXPAND_SZ (Expand String) in
order for the system to, well, expand the value of the named
environment variable. Otherwise it will just look like a literal "%
username%" string as in type REG_SZ.
 
K

Keith

Thank you

Mark V said:
Yes but the valuename "type" must be REG_EXPAND_SZ (Expand String) in
order for the system to, well, expand the value of the named
environment variable. Otherwise it will just look like a literal "%
username%" string as in type REG_SZ.
 

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