XREG.DLL  V3.0
Version 3.0, 27.December 1999

VDS extension written by Ralph Ludwig.

This extension allows creating, reading and deleting of binary, integer, string, expanded-string and multi-string registry-keys. Info-command to check the type of a value.


For this extension to work the script must start with a <External XReg3> command.



important note: 	take care with experiments in the registry !!!
			dont use this extension if you dont know what you are doing !



Syntax:

Commands:

XREG create  (default)   to create a value

XREG read                read a value of any kind (included: REG_MULTI_SZ)

XREG delete              delete a value

XREG info                find out the type of a value


Functions:
create:
<variable> = @XREG(HKEY,SubKey,Name,Type)

read:
XREG read
<variable> = @XREG(HKEY,SubKey,Name,Separator)  

delete:
XREG delete
<variable> = @XREG(HKEY,SubKey,Name)  

info:
XREG info
<variable> = @XREG(HKEY,SubKey,Name)  


Description:

<variable> 	= VDS-Variable	includes 'ok' if everthing is ok
				  	includes errormessage if something is wrong
                                  with the read-command it returns the value

HKEY		= HiveKeyName		HKEY_LOCAL_MACHINE	= HLM
					HKEY_CURRENT_USER	= HCU
					HKEY_USERS		= HU
					HKEY_CLASSES_ROOT	= HCR

SubKey		= name of the subkey.
		  if subkey not exists, it is created

Name		= name of the value.
		  
Type		= the type of the new value		binary	  = REG_BINARY
							string	  = REG_SZ
							integer  = REG_DWORD
							boolean  = REG_DWORD
                                               multi    = REG_MULTI_SZ
                                               expand   = REG_EXPAND_SZ
                                               

Separator    = separator-value only for multistrings (REG_MULTI_SZ).
               this value is optional. If you leave it out, no separator is used.




Examples:

rem  include the extension
external XReg3.dll


- create a key:

rem  create a binary value called test in HKEY_LOCAL_MACHINE\software\_testkey
%X = @XREG(HLM,software\_testkey,test,binary)

rem  fill the new value:    (note:  10 is decimal and become converted to hex (0a)   $ff is already hex)
registry write,local,software\_testkey,test,10,$ff,10,55,$ff,10,20,99,...



- read a value:

rem  set the read-command
XREG read

rem  read value
%X = @XREG(HLM,software\_testkey,test)

rem  read multistring value separeted by '|'
%X = @XREG(HLM,software\_testkey,test,@chr(124)) 

rem  %X now includes the contents of the value  or (if value not exists) the message 'cannot read value'



- delete value

rem  set the delete-command
XREG delete

rem  delete value
%X = @XREG(HLM,software\_testkey,test)

rem  %X now includes the message "value 'name' deleted"  or  "value 'name' not found"  
     or  "cant delete value"  with a number in []. Please tell me, if you ever see this message!


- value info

rem  set the info-command
XREG info

rem  get value-type
%X = @XREG(HLM,software\_testkey,test)

rem  %X now includes REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ, REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR, RESOURCE_REQUIREMENT_LIST or REG_UNKNOWN.



Known bugs:

read binary stops when reading "00" following by "00"

if you find more bugs or have suggestions please write to:  Ralph.Ludwig@lhsysnet.com





History:

V1.0:  1.10.1998
 creating of registrykeys  (binary, string, integer, boolean)

V2.0:  15.12.1999
 adding read of REG_EXPAND_SZ

V2.1:  16.12.1999
 adding read keys of any type (incl. REG_EXPAND_SZ and REG_MULTI_SZ)

V2.2:  21.12.1999
 bugfix (Insufficient memory for operation)

V3.0:  27.12.1999
 adding new commands (delete, info)

