Pregunta: | 8812 - AGREGAR VALOR DE CADENA EN EL REGISTRO |
Autor: | Pedro m. Andrade |
Hola, Mi pregunta es como agregar valor de cadena en el registro de windows a traves de visual basic.
Por ejemplo, quiero que aparezca en "Agregar y Quitar Programas", para eso se utiliza DisplayName y Uninstallstring, se eso pero como les pongo los valores. |
Respuesta: | SuNcO Castañeda |
Hola mi chavo, creo ke la respuesta ke te diero respecto al Registro de Windows no te sirve para lo ke tu estas preguntando, ya ke esas instrucciones solo fueron sacadas de un libro (de un ejemplo) pero solo se graban en tu propio programa, algo complicado, solo te digo ke no te sirve
Yo tengo un .OCX ke ya eh mandado a mas de 3 personas ke preguntan como escribir en el Registro de Windows y a todos les a funcionado a la perfeccion Mandame un mail haciendome tu pregunta y te lo mando junto con un ejemplo |
Respuesta: | José Ariel Limandri |
Fijate si te sirve el sigte ejemplo:
'Crear un Form con 3 CommandButton 'usar HKCU for HKEY_CURRENT_USER 'usar HKLM for HKEY_LOCAL_MACHINE 'usar HKCR for HKEY_CLASSES_ROOT & HKEY_USERS & HKEY_CURRENT_CONFIG Private Sub Form_Load() Command1.Caption = "Escribir" Command2.Caption = "Leer" Command3.Caption = "Borrar" End Sub Private Sub Command1_Click() Dim b As Object On Error Resume Next Set b = CreateObject("wscript.shell") b.RegWrite "HKCU\VBCODE.COM\Value", "Hola Mundo" 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() 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() 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 |