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

Adicionar entradas de chave de registo utilizando ficheiro de lote

Advertisement

Como adicionar as teclas abaixo usando um ficheiro de lote 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

Respostas (2)

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

As linhas seguintes acrescentarão as entradas de registo que está a pedir.

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

Não estou em frente de uma máquina Windows neste momento. Um ficheiro .reg seria o mais apropriado, pois pode automaticamente adicionar e remover chaves. Mas quer um ficheiro .reg em lote.

Pode fazer uma lista de linhas do formulário reg adicionar …….

O comando reg pode adicionar uma chave.

C:\>reg add /? mostra por exemplo

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

Questões relacionadas

3
19
10
28
5
Advertisement
Advertisement