Chapter 21: Accessing The Windows Nt Registry; Setting Registry Values - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 21: Accessing the Windows NT Registry

<CFREGISTRY ACTION="GetAll"
2.
Access the record set (this example uses the CFTABLE tag):
<H1>CFREGISTRY ACTION="GetAll"</H1>
<CFTABLE QUERY="RegQuery" COLHEADERS
<CFCOL HEADER="<B>Entry</B>" WIDTH="35"
<CFCOL HEADER="<B>Type</B>" WIDTH="10"
<CFCOL HEADER="<B>Value</B>" WIDTH="35"
</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"
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#">
BRANCH="HKEY_LOCAL_MACHINE\Software\Microsoft\Java VM"
TYPE="Any" NAME="RegQuery">
HTMLTABLE BORDER="Yes">
TEXT="#RegQuery.Entry#">
TEXT="#RegQuery.Type#">
TEXT="#RegQuery.Value#">
BRANCH="HKEY_LOCAL_MACHINE\Software\Microsoft\Java VM"
ENTRY="ClassPath" TYPE="String" Variable="RegValue">
347

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents