2014-05-31 10:52:38 +0000 2014-05-31 10:52:38 +0000
5
5
Advertisement

Añadir entradas de claves del registro mediante un archivo por lotes

Advertisement

¿Cómo se añaden las siguientes claves utilizando un archivo por lotes puro?

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server]
"DisplayName"="Server"
"DisplayVersion"="1.2"
"InstallLocation"="C:\Program Files\1.2"
"NoModify"=dword:00000001
"Publisher"="ABC"
"UninstallPath"="D:\test\Uninstall.bat"
"UninstallString"="D:\test\Uninstall.bat"
Advertisement
Advertisement

Respuestas (2)

10
10
10
2014-06-01 09:51:51 +0000

Las siguientes líneas añadirán las entradas del registro que se piden.

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v DisplayName /t REG_SZ /d Server
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v DisplayVersion /t REG_SZ /d 1.2
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v InstallLocation /t REG_SZ /d C:\Program Files\1.2
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v NoModify /t REG_DWORD /d 1
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v Publisher /t REG_SZ /d ABC
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v UninstallPath /t REG_SZ /d D:\test\Uninstall.bat
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Server" /v UninstallString /t REG_SZ /d D:\test\Uninstall.bat
4
4
4
2014-05-31 10:59:45 +0000

Ahora mismo no estoy delante de una máquina Windows. Un archivo .reg sería lo más apropiado, ya que puede añadir y eliminar claves automáticamente. Pero quieres un archivo por lotes.

Podrías hacer una lista de líneas de la forma reg add …….

El comando reg puede añadir una clave.

C:\>reg add /? muestra por ejemplo

REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax0x1&mail
  Adds a value (name: MRU, type: REG_MULTI_SZ, data: fax0x1&mail0x1&0x1&)
Advertisement

Preguntas relacionadas

3
19
10
28
6
Advertisement