RegWrite Statement in VB

The RegWrite statement writes Keys and Values into the Windows Registry. The required argument regpath is the path to a Key or Value that will be created if not found. StrToWrite is the data to enter into the key or value specified in regpath.



Private Sub RegWrite(ByVal regpath, ByVal strToWrite)
Dim objShl
Set objShl = CreateObject("wscript.shell")
On Error Resume Next
If IsNumeric( strToWrite ) Then
objShl.RegWrite( regpath, CInt( strToWrite ), "REG_DWORD" )
Else
objShl.RegWrite( regpath, strToWrite )
End If
If Err Then Err.Clear
On Error GoTo 0
Set objShl = Nothing
End Sub



Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: