Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Ddiidev/WindowsRegistry

Windows registry wrappers for Vlang
https://github.com/Ddiidev/WindowsRegistry

Last synced: 3 months ago
JSON representation

Windows registry wrappers for Vlang

Awesome Lists containing this project

README

        

# WindowsRegistry

Windows registry wrappers for Vlang

## Package [vpm.winreg](https://vpm.vlang.io/packages/Ddiidev.winreg)

## Documentation

[Documentation](https://Ddiidev.github.io/WindowsRegistry)

## Funcionalidades

- [X] Update and delete **value**
- [X] List **value** information
- [X] Read value of type only **REG_SZ** and **REG_DWORD**
- [ ] Read value of type **REG_BINARY**, **REG_QDWORD**, **REG_DWORD_BIG_ENDIAN** and **REG_EXPAND_SZ**
- [X] Write value of type only **REG_SZ** and **REG_DWORD**
- [ ] Write value of type **REG_BINARY**, **REG_QDWORD**, **REG_DWORD_BIG_ENDIAN** and **REG_EXPAND_SZ**
- [ ] create new keys
- [ ] Delete keys

## How to use

Getting a string value.

```v
import Ddiidev.winreg

h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_read)!

value := h.query_value[string]('ProgramFilesDir')!

println(value)
```

It is possible to get a value without needing to know the type of the value in the registry.

```v
import Ddiidev.winreg

h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_read)!

value := h.get_value('ProgramFilesDir')!

println(value)

if value is string {
println("value is string")
}
```

Defining and creating new value. (Remembering that you need to be as ADM on Windows)

```v
value_test := 'my_test'

h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_write)!

h.set_value('test', value_test)!
```