Si eres programador, sabrás que el uso de scripts es una herramienta indispensable para automatizar tareas en sistemas operativos. En este artículo, te enseñaremos cómo acceder al registro local mediante VBScript, una práctica que puede facilitar tu trabajo y mejorar la eficiencia de tus desarrollos. Sigue leyendo y descubre lo fácil que es el acceso al registro local con VBScript.
Acceder al registro local es bastante fácil usando VBScript. Aquí hay algunos ejemplos de cómo leer, escribiry borrar información del registro local.
Sintaxis RegRead
object.RegRead(strName)
dim objShell
set objShell=CreateObject("wscript.shell")
strProductName=objShell.RegRead("HKLM\Software\" &_"Microsoft\Windows NT\CurrentVersion\ProductName")
wscript.echo "Your computer is running " & strProductName
Más información sobre el método RegRead: http://msdn.microsoft.com/en-us/library/x05fawxd(VS.85).aspx
Sintaxis RegWrite
object.RegWrite(strName, anyValue [,strType])
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\itgeared\Appname\", &_"SomeString", "REG_SZ"
Más información sobre el método RegWrite: http://msdn.microsoft.com/en-us/library/yfdfhz1b(VS.85).aspx
Sintaxis RegDelete
object.RegDelete(strName)
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegDelete "HKCU\Software\itgeared\Appname\"
Más información sobre el método RegDelete: http://msdn.microsoft.com/en-us/library/293bt9hh(v=VS.85).aspx