Item from Windows registry
valnames = winqueryreg('
name
','rootkey','subkey')
value = winqueryreg('rootkey','subkey','valname')
value = winqueryreg('rootkey','subkey')
valnames = winqueryreg('
returns
all value names in name
','rootkey','subkey')rootkey\subkey
of Microsoft® Windows® operating
system registry to a cell array of character vectors. The first argument
is the literal quoted string, 'name'
.
value = winqueryreg('rootkey','subkey','valname')
returns
the value for valname
in rootkey\subkey
.
If the value retrieved from the registry is a string, winqueryreg
returns
a character vector. If the value is a 32-bit integer, winqueryreg
returns
the value as an integer of the MATLAB® type int32
.
value = winqueryreg('rootkey','subkey')
returns
a value in rootkey\subkey
that has no value name
property.
Note
The literal |
Get the value of CLSID
for the MATLAB sample Microsoft COM control mwsampctrl.2
:
winqueryreg 'HKEY_CLASSES_ROOT' 'mwsamp.mwsampctrl.2\clsid'
ans = {5771A80A-2294-4CAC-A75B-157DCDDD3653}
Get a list in variable mousechar
for registry
subkey Mouse
, which is under subkey Control
Panel
, which is under root key HKEY_CURRENT_USER
.
mousechar = winqueryreg('name','HKEY_CURRENT_USER','control panel\mouse');
For each name in the mousechar
list, get
its value from the registry and then display the name and its value:
for k = 1:length(mousechar) setting = winqueryreg('HKEY_CURRENT_USER','control panel\mouse', mousechar{k}); str = sprintf('%s = %s',mousechar{k},num2str(setting)); disp(str) end
ActiveWindowTracking = 0 DoubleClickHeight = 4 DoubleClickSpeed = 830 DoubleClickWidth = 4 MouseSpeed = 1 MouseThreshold1 = 6 MouseThreshold2 = 10 SnapToDefaultButton = 0 SwapMouseButtons = 0