Ver Mensaje Individual
  #6 (permalink)  
Antiguo 25/04/2009, 12:03
luzstellan
 
Fecha de Ingreso: febrero-2009
Mensajes: 27
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: metodo de copia de registros HKLM

no mira la verdad no me funciona mira como lo estoy haciendo alguna cosa te agradeceria me colaboras

Cita:
'Variable para acceder al Registro mediante Wsh - Windows Scripting Host
Dim O_Registro As WshShell

Dim a As WshShell
Private Const LocalMachine As String = "HKEY_LOCAL_MACHINE"
Private Const CurrentUser As String = "HKEY_CURRENT_USER"


'Private Sub Command1_Click()
'MsgBox Leer_Dato(CurrentUser, "iCurrDigits"), vbInformation
'End Sub
Private Sub Command1_Click()
Dim Obj_Fso As Object
Set Obj_Fso = CreateObject("WScript.Shell")
'O_Registro.RegRead (Principal & "\SOFTWARE\TROYASOFT\Prueba\" & Valor)
O_Registro.RegRead (Principal & "\SOFTWARE\TROYASOFT\Prueba\" & Valor)

O_Registro.RegWrite "HKCU\SOFTWARE\Troyasoft\Prueba\"
'O_Registro.RegWrite "HKCU\Software\Prueba\caso", 1, "REG_SZ"
' Leer_Dato = O_Registro.RegRead(Principal & "\Control Panel\International\" & Valor)
''Set Obj_Fso = CopyObject("Scripting.FileSystemObject")
''O_Registro.RegRead "HKLM\SOFTWARE\Troyasoft\Prueba\caso", 1, "REG_SZ"
' Leer_Dato = O_Registro.RegRead("HKLM\SOFTWARE\Troyasoft\Prueba \caso", 1, "REG_SZ" & Valor)
' Leer_Dato = O_Registro.RegWrite("HKCU\Software\")
End Sub




Private Sub Command2_Click()
End

End Sub

Function crear_Dato(Principal As String, Valor As String) As String
' Leer_Dato = O_Registro.RegWrite(Principal & "\SOFTWARE\TROYASOFT\Prueba\" & Valor)
'O_Registro.RegWrite "HKCU\Software\Prueba\caso", 1, "REG_SZ"
'O_Registro.RegWrite ("HKCU\Software\Prueba" & Valor)
End Function

Function Leer_Dato(Principal As String, Valor As String) As String
Leer_Dato = O_Registro.RegRead(Principal & "\SOFTWARE\TROYASOFT\Prueba\" & Valor)
'O_Registro.RegWrite "HKCU\Software\Prueba\caso", 1, "REG_SZ"

' Leer_Dato = O_Registro.RegRead("HKLM\SOFTWARE\Troyasoft\Prueba \caso", 1, "REG_SZ" & Valor)
' Leer_Dato = O_Registro.RegWrite("HKCU\Software\")
End Function


Private Sub Command3_Click()

MsgBox Leer_Dato(LocalMachine, "caso"), vbInformation

End Sub

Private Sub Command4_Click()


'"HKCU\SOFTWARE\Troyasoft\Prueba\caso" ' & Valor, "REG_SZ"
End Sub

Private Sub Form_Load()
Set O_Registro = New WshShell



End Sub

Private Sub Form_Unload(Cancel As Integer)
Set O_Registro = Nothing
End Sub