Chapter 21: Accessing the Windows NT Registry
347
<CFREGISTRY ACTION="GetAll"
BRANCH="HKEY_LOCAL_MACHINE\Software\Microsoft\Java VM"
TYPE="Any" NAME="RegQuery">
2.
Access the record set (this example uses the CFTABLE tag):
<H1>CFREGISTRY ACTION="GetAll"</H1>
<CFTABLE QUERY="RegQuery" COLHEADERS
HTMLTABLE BORDER="Yes">
<CFCOL HEADER="<B>Entry</B>" WIDTH="35"
TEXT="#RegQuery.Entry#">
<CFCOL HEADER="<B>Type</B>" WIDTH="10"
TEXT="#RegQuery.Type#">
<CFCOL HEADER="<B>Value</B>" WIDTH="35"
TEXT="#RegQuery.Value#">
</CFTABLE>
Getting a specific value
Use CFREGISTRY with the GET action to access a single registry value and store it in a
ColdFusion variable.
To get a specific registry value:
1.
Code a CFREGISTRY tag with the GET action, specifying the branch, the entry to
be accessed, the type (optional), and a variable in which to return the value.
<CFREGISTRY ACTION="Get"
BRANCH="HKEY_LOCAL_MACHINE\Software\Microsoft\Java VM"
ENTRY="ClassPath" TYPE="String" Variable="RegValue">
2.
Access the variable:
<H1>CFREGISTRY ACTION="Get"</H1>
<CFOUTPUT>
<P>
Java ClassPath value is #RegValue#
</CFOUTPUT>
Setting Registry Values
Use CFREGISTRY with the SET action to add a registry key, add a new value, or update
value data. CFREGISTRY creates the key or value if it does not exist.
To set a registry value:
Call the CFREGISTRY tag with the SET action, specifying the branch, the entry to set,
the type of data contained in the value, and the value data. This example assumes a
session variable named LastFileName:
<CFREGISTRY ACTION="Set"
BRANCH="HKEY_LOCAL_MACHINE\Software\cflangref"
ENTRY="LastCFM01" TYPE="String"
VALUE="#SESSION.LastFileName#">
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...