作者: ESET David 時間: 2009-2-19 14:41 標題: 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 編輯 ]
作者: ESET David 時間: 2009-2-19 15:01
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]
- ::OfficescanUninstall
- if not exist "C:\Program Files\Trend Micro\Client Server Security Agent\TmListen.exe" goto InstallNod (先測試 Trend Micro Office Scan 是否已經安裝; 如沒有, 直接裝 nod32)
- regedit /s \\SERVERIP\nod32\uninstall_trendmicro_bit.reg (先執行 "uninstall_trendmicro_bit.reg" 來 disable trend micro 的 uninstall protection)
- "C:\Program Files\Trend Micro\Client Server Security Agent\ntrmv.exe" (執行 Trend Micro 自己的 uninstaller) goto Wait (進入等候模式, 給時間 TM uninstaller 完成指令)
- :Wait
- echo Press any key to continue when uninstall is completed... (在畫面打出這句, 提示用家在 TM 移除成功後按任何鍵繼續)
- pause (暫停 batch 的運行)
- :InstallNod
- if exist "C:\Program Files\ESET\ESET NOD32 Antivirus" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
- if exist "C:\Program Files\ESET\NOD32" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
- ::DisableOFSW (這一段是用來 disable 一些 windows security 提示, 讓 nod32 能順利地全自動完成安裝, 之後會 re-enable)
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 0 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 0 /f
- if %OS%==Windows_NT goto nt (檢查 os 是否 2k/xp/vista)
- :nt
- regedit /s \\SERVERIP\nod32\add_lowrisk.reg (利用 "add_lowrisk.reg" 把 .msi 列為低風險的檔案, 讓 nod32 installer 能全自動順利執行)
- \\SERVERIP\nod32\eavbe_nt32_cht.msi /quiet /qb! /forcerestart (執行 nod32 安裝)
- regedit /s \\SERVERIP\nod32\rm_lowrisk.reg (利用 "rm_lowrisk.reg" 把 .msi 回復為原本)
- ::EnableOFSW (這一段是用來 re-enable 一些 windows security 的提示)
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 1 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 12000 /f
- :end
- exit (完成)
[uninstall_trendmicro_bit.reg]
- Windows Registry Editor Version 5.00
- [HKEY_LOCAL_MACHINE\Software\TrendMicro\PC-cillinNTCorp\Misc.]
- "Allow Uninstall"=dword:00000001
[add_lowrisk.reg]
- Windows Registry Editor Version 5.00
- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
- "LowRiskFileTypes"=".msi"
[rm_lowrisk.reg]
- Windows Registry Editor Version 5.00
- [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
[ 本帖最後由 ESET David 於 2009-2-19 15:39 編輯 ]
https://h2.hkepc.com/forum/attachment.php?aid=804053&k=5f65da91b688d930030ff8d58267e8ec&t=1781541245&sid=160mRBqfECa
作者: ESET David 時間: 2009-2-19 16:08
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]
- ::Symantec Corporate 10.1 Uninstall batch
- if exist "C:\Program Files\Symantec" goto RemoveCorporate101 (檢查 symantec 是否已安裝, 如果是, 執行解除安裝)
- if not exist "C:\Program Files\Symantec" goto end (如果未有安裝 symantec, 則沒有動作)
- :RemoveCorporate101
- regedit /s \\SERVERIP\SHAREFOLDER\virus_protect.reg (利用 "virus_protect.reg" 來 disable Virus software 的 uninstall protection)
- ::Symantec Corporate 10.1.7.7000 product code
- msiexec /x {2085C617-589C-40F8-BE40-EDBC9E2CA2EB} /qb- (執行移除 Symantec Corporate 10.1.7.7000)
- ::Symantec Corporate 10.1.6.6000 product code
- msiexec /x {50E125D1-88E5-48CE-80AE-98EC9698E639} /qb- (執行移除 Symantec Corporate 10.1.6.6000)
- ::Symantec Corporate LiveUpdate uninstaller
- "C:\Program Files\Symantec\LiveUpdate\LSETUP.EXE" /U /q (執行移除 LiveUpdate 元件)
- :end
- exit (完成)
[install_nod32.bat]
- ::NOD32 Installation batch
- if exist "C:\Program Files\ESET\ESET NOD32 Antivirus" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
- if exist "C:\Program Files\ESET\ESET Smart Security" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
- if exist "C:\Program Files\ESET\NOD32" goto end (測試 nod32 是否已經安裝, 如已裝, 則不繼續安裝 nod32)
- ::DisableOFSW (這一段是用來 disable 一些 windows security 提示, 讓 nod32 能順利地全自動完成安裝, 之後會 re-enable)
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 0 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 0 /f
- if %OS%==Windows_NT goto nt (檢查 os 是否 2k/xp/vista)
- :nt
- regedit /s \\SERVERIP\nod32\add_lowrisk.reg (利用 "add_lowrisk.reg" 把 .msi 列為低風險的檔案, 讓 nod32 installer 能全自動順利執行)
- \\SERVERIP\nod32\eavbe_nt32_cht.msi /quiet /qb- (執行 nod32 安裝)
- regedit /s \\SERVERIP\nod32\rm_lowrisk.reg (利用 "rm_lowrisk.reg" 把 .msi 回復為原本)
- ::EnableOFSW (這一段是用來 re-enable 一些 windows security 的提示)
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "1806" /t REG_DWORD /d 1 /f
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v "CurrentLevel" /t REG_DWORD /d 12000 /f
- :Restart Countdown (電腦將於安裝nod32後的90秒自動restart)
- shutdown -r -t 90 -c "The computer will restart after installing NOD32, please wait..."
- :end
- exit (完成)
[virus_protect.reg]
- Windows Registry Editor Version 5.00
- [HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LANDesk\VirusProtect6\CurrentVersion\AdministratorOnly\Security]
- "LockUnloadServices"=dword:00000000
- "UseVPUninstallPassword"=dword:00000000
[add_lowrisk.reg]
- Windows Registry Editor Version 5.00
- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
- "LowRiskFileTypes"=".msi"
[rm_lowrisk.reg]
- Windows Registry Editor Version 5.00
- [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations]
[ 本帖最後由 ESET David 於 2009-2-19 16:11 編輯 ]
https://h2.hkepc.com/forum/attachment.php?aid=804057&k=d7a5c22687b4fd63f5dcf4ef16dacae6&t=1781541245&sid=160mRBqfECa
