<<

Contents

Search

>>

 

SET_REGISTRY_VALUE

 

 

Function

 

 

Syntax:

SET_REGISTRY_VALUE(<Hkey>,<Subkey>,<Name>,<Value>,<Datatype>)

 

<Hkey>

= <STRING-EXPRESSION>

<Subkey>

= <STRING-EXPRESSION>

<Name>

= <STRING-EXPRESSION>

<Value>

= <STRING-EXPRESSION>

<Datatype>

= <NUM-EXPRESSION>

 

 

Meaning:

Stores under WINDOWS an entry in the WINDOWS registry.

 

<Hkey> must contain one of the following root keys:

 

                 HKEY_CLASSES_ROOT
                 HKEY_CURRENT_CONFIG
                 HKEY_CURRENT_USER
                 HKEY_DYN_DATA
                 HKEY_LOCAL_MACHINE
                 HKEY_PERFORMANCE_DATA
                 HKEY_PERFORMANCE_NLSTEXT
                 HKEY_PERFORMANCE_TEXT
                 HKEY_USERS

 

<Subkey> contains the path in <Hkey> , in which the value of <Name> is stored.

 

If <Name> contains the empty string "", only the key <Subkey> is created in the registry.

 

If <Datatype> = 3 (binary object), <Value> must contain the values of the bytes of the binary object separated by ";".

 

SET_REGISTRY_VALUE returns 0 if the entry could be stored.

In the case of an error SET_REGISTRY_VALUE returns -1 and ERRORTEXT$ contains the error text.

 

In order to access the WINDOWS registry the JNA package (Java Native Access) has to be installed:

set CLASSPATH =jna-3.5.2.jar;jna-platform-3.5.2.jar;%CLASSPATH%

 

Parameter:

Hkey

Root key

Subkey

Path in <Hkey>

Name

Data element

Value

Value of data element <Name>

Datatype

Specifies the datatype of <Value>:

1 = DWORD

2 = QWORD

3 = BINARY

otherwise = STRING

 

Sample:

RET% = SET_REGISTRY_VALUE("HKEY_LOCAL_MACHINE","Software\Ebusoft",

                          "Version","4",1)

 

IF RET% = -1

THEN ERRORMES = "Fehler: " + ERRORTEXT$

ENDIF

 

// binary object

B$ = "1;13;255;68;4"

RET% = SET_REGISTRY_VALUE("HKEY_LOCAL_MACHINE","Software\Ebusoft",

                          "Blob",B$,3)

 

IF RET% = -1

THEN ERRORMES = "Fehler: " + ERRORTEXT$

ENDIF

 

See also:

SET_REGISTRY_VALUE_CLIENT

DEL_REGISTRY_VALUE

DEL_REGISTRY_VALUE_CLIENT

GET_REGISTRY_VALUE$

GET_REGISTRY_VALUE_CLIENT$