ESET 最新企業版資訊: 如何大規模轉用 NOD32? (最後更新 20090219)

此篇主題旨在與大家分享如何利用 BATCH FILE 來在企業環境大規模移除舊有防毒軟件, 並裝上 NOD32.
BATCH FILE 可以經 server active directory 派出去 workstation, 方便又快捷.
但用家必須擁有一定 programming 知識才能理解和加以調校.
用家最好在大規模實行前先找數部 workstation 做測試, 以免出現災難性後果.

[以下資料純粹作分享之用, 觀迎各位參考]

Example 1: 移除 Trend Micro Office Scan

Example 2: 移除 Symantec Corporate 10.1 (10.1.7.7000 or 10.1.6.6000)

[ 本帖最後由 ESET David 於 2009-2-28 13:07 編輯 ]

Example 1: 移除 Trend Micro Office Scan

在開始前, 請先在 server 開一個 folder "nod32", 並 share 出來.

需要的檔案: 共5個
install.bat [在 AD 派出]
add_lowrisk.reg [放在 nod32 share folder]
rm_lowrisk.reg [放在 nod32 share folder]
uninstall_trendmicro_bit.reg [放在 nod32 share folder]
eavbe_nt32_cht.msi [放在 nod32 share folder] - 此乃 nod32 installation file, 如果有 config .xml file, 可以同時放在 sharefolder 內, 當 .msi 安裝進行時, config 便會自己食埋入去)

*****************************
[install.bat]
  1. ::OfficescanUninstall
  2. if not exist "C:\Program Files\Trend Micro\Client Server Security Agent\TmListen.exe" goto InstallNod (先測試 Trend Micro Office Scan 是否已經安裝; 如沒有, 直接裝 nod32)
  3. regedit /s \\SERVERIP\nod32\uninstall_trendmicro_bit.reg (先執行 "uninstall_trendmicro_bit.reg" 來 disable trend micro 的 uninstall protection)
  4. "C:\Program Files\Trend Micro\Client Server Security Agent\ntrmv.exe" (執行 Trend Micro 自己的 uninstaller) goto Wait (進入等候模式, 給時間 TM uninstaller 完成指令)

  5. :Wait
  6. echo Press any key to continue when uninstall is completed... (在畫面打出這句, 提示用家在 TM 移除成功後按任何鍵繼續)
  7. pause (暫停 batch 的運行)

  8. :InstallNod
  9. if exist "C:\Program Files\ESET\ESET NOD32 Antivirus" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
  10. if exist "C:\Program Files\ESET\NOD32" goto end  (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)

  11. ::DisableOFSW (這一段是用來 disable 一些 windows security 提示, 讓 nod32 能順利地全自動完成安裝, 之後會 re-enable)
  12. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 0 /f
  13. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 0 /f


  14. if %OS%==Windows_NT goto nt (檢查 os 是否 2k/xp/vista)

  15. :nt
  16. regedit /s \\SERVERIP\nod32\add_lowrisk.reg (利用 "add_lowrisk.reg" 把 .msi 列為低風險的檔案, 讓 nod32 installer 能全自動順利執行)
  17. \\SERVERIP\nod32\eavbe_nt32_cht.msi /quiet /qb! /forcerestart (執行 nod32 安裝)
  18. regedit /s \\SERVERIP\nod32\rm_lowrisk.reg (利用 "rm_lowrisk.reg" 把 .msi 回復為原本)

  19. ::EnableOFSW (這一段是用來 re-enable 一些 windows security 的提示)
  20. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 1 /f
  21. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 12000 /f

  22. :end
  23. exit (完成)
複製代碼
***************
[uninstall_trendmicro_bit.reg]
  1. Windows Registry Editor Version 5.00

  2. [HKEY_LOCAL_MACHINE\Software\TrendMicro\PC-cillinNTCorp\Misc.]
  3. "Allow Uninstall"=dword:00000001
複製代碼
****************
[add_lowrisk.reg]
  1. Windows Registry Editor Version 5.00


  2. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
  3. "LowRiskFileTypes"=".msi"
複製代碼
****************
[rm_lowrisk.reg]
  1. Windows Registry Editor Version 5.00

  2. [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
複製代碼

[ 本帖最後由 ESET David 於 2009-2-19 15:39 編輯 ]

Trend Micro OfficeScan.zip (1.3 KB)

TOP

Example 2: 移除 Symantec Corporate 10.1 (10.1.7.7000 or 10.1.6.6000)

在開始前, 請先在 server 開一個 folder "nod32", 並 share 出來.

需要的檔案: 共6個
uninstall_corporate101.bat [在 AD 派出]
install_nod32.bat [在AD派出]
virus_protect.reg [放在 nod32 share folder]
add_lowrisk.reg [放在 nod32 share folder]
rm_lowrisk.reg [放在 nod32 share folder]
eavbe_nt32_cht.msi [放在 nod32 share folder] - 此乃 nod32 installation file, 如果有 config .xml file, 可以同時放在 sharefolder 內, 當 .msi 安裝進行時, config 便會自己食埋入去)

*****************************
[uninstall_corporate101.bat]
  1. ::Symantec Corporate 10.1 Uninstall batch
  2. if exist "C:\Program Files\Symantec" goto RemoveCorporate101 (檢查 symantec 是否已安裝, 如果是, 執行解除安裝)
  3. if not exist "C:\Program Files\Symantec" goto end (如果未有安裝 symantec, 則沒有動作)

  4. :RemoveCorporate101
  5. regedit /s \\SERVERIP\SHAREFOLDER\virus_protect.reg (利用 "virus_protect.reg" 來 disable Virus software 的 uninstall protection)

  6. ::Symantec Corporate 10.1.7.7000 product code
  7. msiexec /x {2085C617-589C-40F8-BE40-EDBC9E2CA2EB} /qb- (執行移除 Symantec Corporate 10.1.7.7000)

  8. ::Symantec Corporate 10.1.6.6000 product code
  9. msiexec /x {50E125D1-88E5-48CE-80AE-98EC9698E639} /qb- (執行移除 Symantec Corporate 10.1.6.6000)

  10. ::Symantec Corporate LiveUpdate uninstaller
  11. "C:\Program Files\Symantec\LiveUpdate\LSETUP.EXE" /U /q (執行移除 LiveUpdate 元件)

  12. :end
  13. exit (完成)
複製代碼
*****************************
[install_nod32.bat]
  1. ::NOD32 Installation batch
  2. if exist "C:\Program Files\ESET\ESET NOD32 Antivirus" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
  3. if exist "C:\Program Files\ESET\ESET Smart Security" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
  4. if exist "C:\Program Files\ESET\NOD32" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)

  5. ::DisableOFSW (這一段是用來 disable 一些 windows security 提示, 讓 nod32 能順利地全自動完成安裝, 之後會 re-enable)
  6. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 0 /f
  7. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 0 /f


  8. if %OS%==Windows_NT goto nt (檢查 os 是否 2k/xp/vista)

  9. :nt
  10. regedit /s \\SERVERIP\nod32\add_lowrisk.reg (利用 "add_lowrisk.reg" 把 .msi 列為低風險的檔案, 讓 nod32 installer 能全自動順利執行)
  11. \\SERVERIP\nod32\eavbe_nt32_cht.msi /quiet /qb- (執行 nod32 安裝)
  12. regedit /s \\SERVERIP\nod32\rm_lowrisk.reg (利用 "rm_lowrisk.reg" 把 .msi 回復為原本)

  13. ::EnableOFSW (這一段是用來 re-enable 一些 windows security 的提示)
  14. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 1 /f
  15. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 12000 /f

  16. :Restart Countdown (電腦將於安裝nod32後的90秒自動restart)
  17. shutdown -r -t 90 -c "The computer will restart after installing NOD32, please wait..."

  18. :end
  19. exit (完成)
複製代碼
*****************************
[virus_protect.reg]
  1. Windows Registry Editor Version 5.00


  2. [HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LANDesk\VirusProtect6\CurrentVersion\AdministratorOnly\Security]
  3. "LockUnloadServices"=dword:00000000
  4. "UseVPUninstallPassword"=dword:00000000
複製代碼
*****************************
[add_lowrisk.reg]
  1. Windows Registry Editor Version 5.00


  2. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
  3. "LowRiskFileTypes"=".msi"
複製代碼
*****************************
[rm_lowrisk.reg]
  1. Windows Registry Editor Version 5.00

  2. [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
複製代碼

[ 本帖最後由 ESET David 於 2009-2-19 16:11 編輯 ]

Symantec Corporate 10.1.zip (1.66 KB)

TOP