1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" RCS: @(#) $Id: registry.n,v 1.1.1.1 2002-01-16 10:25:25 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH registry n 8.0 Tcl "Tcl Built-In Commands"
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
registry \- Manipulate the Windows registry
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
.sp
|
17 |
|
|
\fBpackage require registry 1.0\fR
|
18 |
|
|
.sp
|
19 |
|
|
\fBregistry \fIoption\fR \fIkeyName\fR ?\fIarg arg ...\fR?
|
20 |
|
|
.BE
|
21 |
|
|
|
22 |
|
|
.SH DESCRIPTION
|
23 |
|
|
.PP
|
24 |
|
|
The \fBregistry\fR package provides a general set of operations for
|
25 |
|
|
manipulating the Windows registry. The package implements the
|
26 |
|
|
\fBregistry\fR Tcl command. This command is only supported on the
|
27 |
|
|
Windows platform. Warning: this command should be used with caution
|
28 |
|
|
as a corrupted registry can leave your system in an unusable state.
|
29 |
|
|
.PP
|
30 |
|
|
\fIKeyName\fR is the name of a registry key. Registry keys must be
|
31 |
|
|
one of the following forms:
|
32 |
|
|
.IP
|
33 |
|
|
\fB\e\e\fIhostname\fB\e\fIrootname\fB\e\fIkeypath\fR
|
34 |
|
|
.IP
|
35 |
|
|
\fIrootname\fB\e\fIkeypath\fR
|
36 |
|
|
.IP
|
37 |
|
|
\fIrootname\fR
|
38 |
|
|
.PP
|
39 |
|
|
\fIHostname\fR specifies the name of any valid Windows
|
40 |
|
|
host that exports its registry. The \fIrootname\fR component must be
|
41 |
|
|
one of \fBHKEY_LOCAL_MACHINE\fR, \fBHKEY_USERS\fR,
|
42 |
|
|
\fBHKEY_CLASSES_ROOT\fR, \fBHKEY_CURRENT_USER\fR, or
|
43 |
|
|
\fBHKEY_CURRENT_CONFIG\fR. The \fIkeypath\fR can be one or more
|
44 |
|
|
registry key names separated by backslash (\fB\e\fR) characters.
|
45 |
|
|
.PP
|
46 |
|
|
\fIOption\fR indicates what to do with the registry key name. Any
|
47 |
|
|
unique abbreviation for \fIoption\fR is acceptable. The valid options
|
48 |
|
|
are:
|
49 |
|
|
.TP
|
50 |
|
|
\fBregistry delete \fIkeyName\fR ?\fIvalueName\fR?
|
51 |
|
|
.
|
52 |
|
|
If the optional \fIvalueName\fR argument is present, the specified
|
53 |
|
|
value under \fIkeyName\fR will be deleted from the registry. If the
|
54 |
|
|
optional \fIvalueName\fR is omitted, the specified key and any subkeys
|
55 |
|
|
or values beneath it in the registry heirarchy will be deleted. If
|
56 |
|
|
the key could not be deleted then an error is generated. If the key
|
57 |
|
|
did not exist, the command has no effect.
|
58 |
|
|
.TP
|
59 |
|
|
\fBregistry get \fIkeyName valueName\fR
|
60 |
|
|
.
|
61 |
|
|
Returns the data associated with the value \fIvalueName\fR under the key
|
62 |
|
|
\fIkeyName\fR. If either the key or the value does not exist, then an
|
63 |
|
|
error is generated. For more details on the format of the returned
|
64 |
|
|
data, see SUPPORTED TYPES, below.
|
65 |
|
|
.TP
|
66 |
|
|
\fBregistry keys \fIkeyName\fR ?\fIpattern\fR?
|
67 |
|
|
.
|
68 |
|
|
If \fIpattern\fR isn't specified, returns a list of names of all the
|
69 |
|
|
subkeys of \fIkeyName\fR. If \fIpattern\fR is specified, only those
|
70 |
|
|
names matching \fIpattern\fR are returned. Matching is determined
|
71 |
|
|
using the same rules as for \fBstring\fR \fBmatch\fR. If the
|
72 |
|
|
specified \fIkeyName\fR does not exist, then an error is generated.
|
73 |
|
|
.TP
|
74 |
|
|
\fBregistry set \fIkeyName\fR ?\fIvalueName data \fR?\fItype\fR??
|
75 |
|
|
.
|
76 |
|
|
If \fIvalueName\fR isn't specified, creates the key \fIkeyName\fR if
|
77 |
|
|
it doesn't already exist. If \fIvalueName\fR is specified, creates
|
78 |
|
|
the key \fIkeyName\fR and value \fIvalueName\fR if necessary. The
|
79 |
|
|
contents of \fIvalueName\fR are set to \fIdata\fR with the type
|
80 |
|
|
indicated by \fItype\fR. If \fItype\fR isn't specified, the type
|
81 |
|
|
\fBsz\fR is assumed. For more details on the data and type arguments,
|
82 |
|
|
see SUPPORTED TYPES below.
|
83 |
|
|
.TP
|
84 |
|
|
\fBregistry type \fIkeyName valueName\fR
|
85 |
|
|
.
|
86 |
|
|
Returns the type of the value \fIvalueName\fR in the key
|
87 |
|
|
\fIkeyName\fR. For more information on the possible types, see
|
88 |
|
|
SUPPORTED TYPES, below.
|
89 |
|
|
.TP
|
90 |
|
|
\fBregistry values \fIkeyName\fR ?\fIpattern\fR?
|
91 |
|
|
.
|
92 |
|
|
If \fIpattern\fR isn't specified, returns a list of names of all the
|
93 |
|
|
values of \fIkeyName\fR. If \fIpattern\fR is specified, only those
|
94 |
|
|
names matching \fIpattern\fR are returned. Matching is determined
|
95 |
|
|
using the same rules as for \fBstring\fR \fBmatch\fR.
|
96 |
|
|
|
97 |
|
|
.SH "SUPPORTED TYPES"
|
98 |
|
|
Each value under a key in the registry contains some data of a
|
99 |
|
|
particular type in a type-specific representation. The \fBregistry\fR
|
100 |
|
|
command converts between this internal representation and one that can
|
101 |
|
|
be manipulated by Tcl scripts. In most cases, the data is simply
|
102 |
|
|
returned as a Tcl string. The type indicates the intended use for the
|
103 |
|
|
data, but does not actually change the representation. For some
|
104 |
|
|
types, the \fBregistry\fR command returns the data in a different form to
|
105 |
|
|
make it easier to manipulate. The following types are recognized by the
|
106 |
|
|
registry command:
|
107 |
|
|
.TP 17
|
108 |
|
|
\fBbinary\fR
|
109 |
|
|
.
|
110 |
|
|
The registry value contains arbitrary binary data. The data is represented
|
111 |
|
|
exactly in Tcl, including any embedded nulls.
|
112 |
|
|
Tcl
|
113 |
|
|
.TP
|
114 |
|
|
\fBnone\fR
|
115 |
|
|
.
|
116 |
|
|
The registry value contains arbitrary binary data with no defined
|
117 |
|
|
type. The data is represented exactly in Tcl, including any embedded
|
118 |
|
|
nulls.
|
119 |
|
|
.TP
|
120 |
|
|
\fBsz\fR
|
121 |
|
|
.
|
122 |
|
|
The registry value contains a null-terminated string. The data is
|
123 |
|
|
represented in Tcl as a string.
|
124 |
|
|
.TP
|
125 |
|
|
\fBexpand_sz\fR
|
126 |
|
|
.
|
127 |
|
|
The registry value contains a null-terminated string that contains
|
128 |
|
|
unexpanded references to environment variables in the normal Windows
|
129 |
|
|
style (for example, "%PATH%"). The data is represented in Tcl as a
|
130 |
|
|
string.
|
131 |
|
|
.TP
|
132 |
|
|
\fBdword\fR
|
133 |
|
|
.
|
134 |
|
|
The registry value contains a little-endian 32-bit number. The data is
|
135 |
|
|
represented in Tcl as a decimal string.
|
136 |
|
|
.TP
|
137 |
|
|
\fBdword_big_endian\fR
|
138 |
|
|
.
|
139 |
|
|
The registry value contains a big-endian 32-bit number. The data is
|
140 |
|
|
represented in Tcl as a decimal string.
|
141 |
|
|
.TP
|
142 |
|
|
\fBlink\fR
|
143 |
|
|
.
|
144 |
|
|
The registry value contains a symbolic link. The data is represented
|
145 |
|
|
exactly in Tcl, including any embedded nulls.
|
146 |
|
|
.TP
|
147 |
|
|
\fBmulti_sz\fR
|
148 |
|
|
.
|
149 |
|
|
The registry value contains an array of null-terminated strings. The
|
150 |
|
|
data is represented in Tcl as a list of strings.
|
151 |
|
|
.TP
|
152 |
|
|
\fBresource_list\fR
|
153 |
|
|
.
|
154 |
|
|
The registry value contains a device-driver resource list. The data
|
155 |
|
|
is represented exactly in Tcl, including any embedded nulls.
|
156 |
|
|
.PP
|
157 |
|
|
In addition to the symbolically named types listed above, unknown
|
158 |
|
|
types are identified using a 32-bit integer that corresponds to the
|
159 |
|
|
type code returned by the system interfaces. In this case, the data
|
160 |
|
|
is represented exactly in Tcl, including any embedded nulls.
|
161 |
|
|
|
162 |
|
|
.SH "PORTABILITY ISSUES"
|
163 |
|
|
The registry command is only available on Windows.
|
164 |
|
|
|
165 |
|
|
.SH KEYWORDS
|
166 |
|
|
registry
|