Me gustaria saber como ejecutar un *.reg desde visual basic
Valora esta pregunta
0
Responder
RE:Como puedo ejecutar desde Vb un *.reg
Publicado por Belén (1 intervención) el 05/06/2002 15:59:00
Me ocurre algo parecido. Yo quiero leer el registro del sistema, luego cambiarlo y luego volver a insertar los valores que tenía.
En lugar de ejecutar un *.reg, puedes cambiar directamente los valores del registro. Para ellos yo he encontrado al siguiente información
WshShell Object
ProgID Wscript.WshShell
File name WSHom.Ocx
RegDelete Deletes a specified key or value from the registry.
RegRead Returns a specified key or value from the registry.
RegWrite Sets a specified key or value in the registry.
WshShell.RegWrite strName, anyValue, [strType]
Parameters
strName
If strName ends with a backslash character (\), this method sets the key instead of the value.
The strName parameter must begin with one of following root key names. Short Long
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_CLASSES_ROOT
HKEY_USERS
HKEY_CURRENT_CONFIG
anyValue
The RegWrite method automatically converts anyValue to a string when strType is REG_SZ or REG_EXPAND_SZ. If strType is REG_DWORD, anyValue is converted to an integer. If strType is REG_BINARY, anyValue must be an integer.
strType
The RegWrite method supports strType as REG_SZ, REG_EXPAND_SZ, REG_DWORD and REG_BINARY. If another data type is passed as strType, RegWrite returns E_INVALIDARG.
Example
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Estimado amigo:
En www.ambsoftware.com encontrarás varios ejemplos que te muestran cómo manejar el registro del sistema desde VB.
Para localizarlos te recomiendo que utilices el buscador de recursos de la página principal y escribas en la casilla la palabra "registro".
Espero que esta información te sirva de ayuda.
Fdo.- Alvaro Marín