Documents

REG

Registry functions


Registry hive enum

Syntax

HKCU
HKCR
HKLM
HKU
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Registry value type Enum

Syntax

reg.none	// No data type
reg.sz		// REG_SZ
reg.expand	// REG_EXPAND_SZ
reg.binary	// REG_BINARY
reg.multi	// REG_MULTI_SZ
reg.dword	// REG_DWORD
reg.qword	// REG_QWORD
The function of reading from the Registry.

Syntax

reg(reg.lm, 'SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName')

reg(reg.cr, 'txtfile\DefaultIcon')
reg.exists

Check that the key or value name exists

Syntax

Check that the key exists

reg.exists('HKCU\Control Panel\Desktop')

Check that the value name exists

reg.exists('HKCU\Control Panel\Desktop', "WallPaper")
reg.get

Read data by value name

Syntax

reg('HKCU\Control Panel\Desktop', "WallPaper")
reg.get('HKCU\Control Panel\Desktop', "WallPaper")
reg.get('HKCU\Control Panel\Desktop')
reg.set

Allows creating a subkey with the value name and value data

Syntax

Create Subkey

reg.set('HKCU\Software\Nilesoft\Shell')

Create Subkey with value and set value data type.

reg.set('HKCU\Software\Nilesoft\Shell', "test-int", 1, reg.dword)
reg.set('HKCU\Software\Nilesoft\Shell', "test-str", 1, reg.sz)
reg.set('HKCU\Software\Nilesoft\Shell', "test-str", 'some string', reg.sz)

Set value data with auto type detection.


reg.set('HKCU\Software\Nilesoft\Shell', 'test-auto-int', 1)
reg.set('HKCU\Software\Nilesoft\Shell', 'test-auto-str', 'some string')
reg.delete

Allows deleting a subkey or deleting a value

Syntax

Delete value name.

reg.delete('HKCU\Software\Nilesoft\Shell', 'test-auto')

Delete subkey.

reg.delete('HKCU\Software\Nilesoft\Shell')
reg.keys

Returns all subkey names

Syntax

reg.keys('HKCU\Software\Nilesoft\Shell')
reg.values

Returns all value names

Syntax

reg.values('HKCU\Software\Nilesoft\Shell')

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub