Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Ferramentas Windows > winqueryreg

winqueryreg

Get item from Microsoft Windows registry (Windows only)

Calling Sequence

value = winqueryreg('name', 'rootkey','subkey')
value = winqueryreg('key', 'rootkey','subkey')
value = winqueryreg('rootkey', 'subkey','valname')
value = winqueryreg('rootkey','subkey')

Description

value = winqueryreg('name', 'rootkey', 'subkey') returns the values names in rootkey\subkey in a matrix of strings. The first argument is the literal quoted string, 'name'.

If the data retrieved from the registry is a string, winqueryreg returns a string. If the data is a 32-bit integer, winqueryreg returns the data as an integer (int32).

value = winqueryreg('key', 'rootkey', 'subkey') returns the keys names in rootkey\subkey in a matrix of strings. The first argument is the literal quoted string, 'key'.

value = winqueryreg('rootkey', 'subkey', 'valname') returns the data for value valname in rootkey\subkey.

value = winqueryreg('rootkey', 'subkey') returns a data in rootkey\subkey that has no value name property.

NoteThe literal name argument, key argument and the rootkey argument are case-sensitive. The subkey and valname arguments are not.

supported root keys are: 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS', 'HKEY_DYN_DATA' and 'HKEY_CURRENT_CONFIG'.

and shortcut names: 'HKCR', 'HKCU', 'HKLM', 'HKU', 'HKDD' and 'HKCC'.

Examples

if getos() == 'Windows' then
    winqueryreg 'HKEY_LOCAL_MACHINE' 'HARDWARE\DESCRIPTION\System\CentralProcessor\0\' 'ProcessorNameString'
    
    mousechar = winqueryreg('name', 'HKEY_CURRENT_USER','control panel\mouse');
    len=size(mousechar);
    for k=1:len(1)
        setting = winqueryreg('HKEY_CURRENT_USER','control panel\mouse', mousechar(k));
        if (mousechar(k)=='') then mousechar(k)='default';,end
        str = msprintf('%s = %s', mousechar(k), string(setting));
        disp(str);
    end
    
    winqueryreg('HKEY_CURRENT_CONFIG', 'Software\Fonts\','LogPixels')
    winqueryreg('key' ,'HKLM', 'Software\Microsoft\.NETFramework')
end

History

VersãoDescrição
5.4.0 This function also manages 'HKEY_CURRENT_CONFIG' key.
5.4.1
  • Manage shorcut root names.
  • Can retrieve key list names.
Report an issue
<< winopen Ferramentas Windows

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:57:52 CEST 2014