Wish Write to windows registry

ThRuST

Well-Known Member
Licensed User
Longtime User
I miss B4J inbuildt functions to read/write from/to the Windows registry. Please add it in next update of B4J, thanks.

For example
If (OS) = "win" then
Dim RegValue As Registry
RegValue.Path("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
RegValue.Set(Path, "c:\Program Files/B4XProject/appname.exe")
Log(RegValue.Get())
End If

Something like that :rolleyes:
 
Last edited:

alienhunter

Active Member
Licensed User
Longtime User
you can make this happen with jshell and cmd easier than writing a new library for this
AH

REG QUERY [ROOT\]RegKey /v ValueName [/s]
REG QUERY [ROOT\]RegKey /ve --This returns the (default) value

REG ADD [ROOT\]RegKey /v ValueName [/t DataType] [/S Separator] [/d Data] [/f]
REG ADD [ROOT\]RegKey /ve [/d Data] [/f] -- Set the (default) value

REG DELETE [ROOT\]RegKey /v ValueName [/f]
REG DELETE [ROOT\]RegKey /ve [/f] -- Remove the (default) value
REG DELETE [ROOT\]RegKey /va [/f] -- Delete all values under this key

REG COPY [\\SourceMachine\][ROOT\]RegKey [\\DestMachine\][ROOT\]RegKey

REG EXPORT [ROOT\]RegKey FileName.reg
REG IMPORT FileName.reg
REG SAVE [ROOT\]RegKey FileName.hiv
REG RESTORE \\MachineName\[ROOT]\KeyName FileName.hiv

REG LOAD KeyName FileName
REG UNLOAD KeyName

REG COMPARE [ROOT\]RegKey [ROOT\]RegKey [/v ValueName] [Output] [/s]
REG COMPARE [ROOT\]RegKey [ROOT\]RegKey [/ve] [Output] [/s]
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Nice idea Alienhunter, I was thinking that those Dos days were over but sometimes there's a need for it. I've been thinking about this myself but did not find a way to pass a relative variable, or can that be passed through jShell? I suppose the answer is obvious but anyway. It would be great if you upload a small source code example with a simple form to this code i.e two buttons 'enable autostart' and 'disable autostart'. It would be nice to see it in action. A registry library wouldn't hurt ;)
 

alienhunter

Active Member
Licensed User
Longtime User
Nice idea Alienhunter, I was thinking that those Dos days were over but sometimes there's a need for it. I've been thinking about this myself but did not find a way to pass a relative variable, or can that be passed through jShell? I suppose the answer is obvious but anyway. It would be great if you upload a small source code example with a simple form to this code i.e two buttons 'enable autostart' and 'disable autostart'. It would be nice to see it in action. A registry library wouldn't hurt ;)

see here
similar to this
https://www.b4x.com/android/forum/threads/execute-windows-vbs-scripts-from-b4j.73612/
 
Top