VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simplest code to write into windows registry without using any API Calls using very few lines of co

by BrijMohan.K (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 3rd August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simplest code to write into windows registry without using any API Calls using very few lines of code for any further details mail me:

API Declarations


Create a form add three command buttons and add the following code
Note: You can write any where into the registry
Conact me [email protected]
use HKCU for HKEY_CURRENT_USER
use HKLM for HKEY_LOCAL_MACHINE
use HKCR for HKEY_CLASSES_ROOT & HKEY_USERS & HKEY_CURRENT_CONFIG
Happy Coding !

Rate Simplest code to write into windows registry without using any API Calls using very few lines of co



Command1.Caption = "Write"
Command2.Caption = "Read"
Command3.Caption = "Delete"
End Sub

Private Sub Command1_Click()
'WRITE INTO WINDOWS REGISTRY
'----------------------------
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite "HKCU\VBCODE.COM\Value", "HELLO WORLD"
b.RegWrite "HKCU\VBCODE.COM\Value1", 0, "REG_DWORD"
b.RegWrite "HKCU\VBCODE.COM\Value2", 0, "REG_SZ"
b.RegWrite "HKCU\VBCODE.COM\Value3", 0, "REG_BINARY"

End Sub

Private Sub Command2_Click()
'READ FROM WINDOWS REGISTRY
'.........................
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
R = b.RegRead("HKCU\VBCODE.COM\Value")
Form1.Caption = R
End Sub

Private Sub Command3_Click()
'DELETE VALUES FROM WINDOWS REGISTRY
'-----------------------------------
Dim b As Object
On Error Resume Next
Set b = CreateObject("Wscript.Shell")
b.RegDelete "HKCU\VBCODE.COM\Value"
b.RegDelete "HKCU\VBCODE.COM\Value1"
b.RegDelete "HKCU\VBCODE.COM\Value2"
b.RegDelete "HKCU\VBCODE.COM\Value3"
End Sub



Download this snippet    Add to My Saved Code

Simplest code to write into windows registry without using any API Calls using very few lines of co Comments

No comments have been posted about Simplest code to write into windows registry without using any API Calls using very few lines of co. Why not be the first to post a comment about Simplest code to write into windows registry without using any API Calls using very few lines of co.

Post your comment

Subject:
Message:
0/1000 characters