WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Registry
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RegQueryEx for REG_EXPAND_SZ


Question:

I thought that a call to regQueryEx for a REG_EXPAND_SZ would return a string in which the environment variable reference has been resolved, but if I run the following script:
Message("Value:", regQueryEx(regM,"Software\Microsoft\Windows NT\CurrentVersion\ProfileList[ProfilesDirectory]"," ", 2))
The message I get is
%SystemDrive%\Documents and Settings
rather than
C:\Documents and Settings
Is this how the function is supposed to behave?

Answer:

RegQueryExpSz gets you the UN-resolved version of the data - the raw contents.

The RegQueryStr function gets you the resolved version of REG_SZ or REG_EXPSZ strings.


Article ID:   W16669
File Created: 2005:02:18:12:21:50
Last Updated: 2005:02:18:12:21:50