一、簡介
最近一直在測試使用域組策略自動部署軟件,效果並不理想。首先,主機必須加入域才能讓策略生效。其實是Windows Server 2012 R2只支持.msi格式的安裝包,所以部署前需將軟件重新封裝;使用“已分配”選項,軟件沒有創建快捷方式,只能在“控制面板—程序”里面添加。
靜默安裝又稱為無人值守安裝,軟件以默認值自動進行安裝。將軟件包放在共享,編寫批處理可批量自動安裝網絡上的軟件,重裝系統后一鍵裝機!實現原理很簡單,就是軟件打包程序預留了安裝參數,安裝時可加上。當查不到或沒預留靜默安裝參數時,只能手動點擊下一步進行安裝。查看安裝參數與查看dos命令幫助相同:/? 。
二、配置
@echo off title Auto Install color 1F
::WinRAR echo. start /wait \\192.168.1.100\Public\Software\WinRAR_x64.exe /s if %errorlevel%==0 (echo WinRAR x64 -- OK) else (echo WinRAR x64 -- error)
::Flash播放器 echo. start /wait \\192.168.1.100\Public\Software\flashplayer_IE.exe /install if %errorlevel%==0 (echo Flash Player for IE -- OK) else (echo Flash Player for IE -- error) echo. start /wait \\192.168.1.100\Public\Software\flashplayer_nIE.exe /install if %errorlevel%==0 (echo Flash Player not for IE -- OK) else (echo Flash Player not for IE -- error)
::搜狗輸入法 echo. start /wait \\192.168.1.100\Public\Software\Sougoupinyin.exe /S if %errorlevel%==0 (echo SougouInput -- OK) else (echo SougouInput -- error)
::Foxit Reader echo. start /wait \\192.168.1.100\Public\Software\FoxitReader.exe /VERYSILENT if %errorlevel%==0 (echo Foxit Reader -- OK) else (echo Foxit Reader -- error)
::AVG,沒查到靜默安裝參數,需手動點擊 echo. start /wait \\192.168.1.100\Public\Software\avg.exe if %errorlevel%==0 (echo AVG Free -- OK) else (echo AVG Free -- error)
::原版Office 2007,尚未設置config.xml,需手動點擊 echo. start /wait \\192.168.1.100\Public\Software\Office2007\setup.exe if %errorlevel%==0 (echo Office Excel -- OK) else (echo Office Excel -- error), echo. start /wait \\192.168.1.100\Public\Software\Office2007\setup.exe if %errorlevel%==0 (echo Office PowerPoint -- OK) else (echo Office PowerPoint -- error) echo. start /wait \\192.168.1.100\Public\Software\Office2007\setup.exe if %errorlevel%==0 (echo Office Word -- OK) else (echo Office Word -- error) echo. pause
非原版Office 2007四合一
mkdir %systemdrive%\Office2007 xcopy /s /q "\\192.168.1.100\Public\Software\Office 2007" "%systemdrive%\Office2007">%temp%\copy.tmp start /wait %systemdrive%\Office2007\install.cmd if %errorlevel%==0 (echo Office 2007 -- OK) else (echo Office 2007 -- error) del %temp%\copy.tmp
本文出自 “運維菜鳥.log” 博客,謝絕轉載!