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

Dodaj wpisy klucza rejestru za pomocą pliku wsadowego

Advertisement

Jak dodać poniższe klucze za pomocą czystego pliku wsadowego?

[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

Odpowiedzi (2)

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

Poniższe linie dodadzą wpisy do rejestru, o które prosisz.

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

Nie mam teraz dostępu do komputera z systemem Windows. Plik .reg byłby najbardziej odpowiedni, ponieważ może on automatycznie dodawać i usuwać klucze. Ale ty chcesz plik wsadowy.

Mógłbyś zrobić listę wierszy w formie reg add …….

Polecenie reg może dodać klucz.

C:\>reg add /? pokazuje na przykład

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

Pytania pokrewne

3
19
10
28
5
Advertisement