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

使用批处理文件添加注册表键项

Advertisement

如何使用纯批处理文件添加以下键?

[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

答案 (2)

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

下面的行将添加你所要求的注册表项。

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

我现在不在Windows机器前。.reg文件是最合适的,因为它可以自动添加和删除键。但你要的是一个批处理文件。

你可以做一个列表行的形式 reg add …….。

reg命令可以添加密钥。

C:\>reg add /? 显示的是例如

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

相关问题

3
19
10
28
13
Advertisement
Advertisement