windows 批量软件安装脚本

脚本引用有一些外部工具:

nircmd.exe   http://www.nirsoft.net/utils/nircmd.html
uins.exe       出处不祥
7za.exe        http://www.7-zip.org/download.html
IMETool.exe    http://www.crsky.com/soft/4953.html
filever.exe    http://support.microsoft.com/kb/913111

软件安装包存放路径 :\\192.168.2.12\shared\software\
辅助小工具存放路径 :\\192.168.2.12\shared\install\bin\

@echo off
setlocal ENABLEDELAYEDEXPANSION
set SRVPATH=\\192.168.2.12\shared
set BINPATH=\\192.168.2.12\shared\install\bin
reg add HKCR\Msi.Package /v EditFlags /t reg_dword /d 1114112 /f 1>nul 2>nul
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations /v ModRiskFileTypes /t REG_SZ /d .msi;.exe /f 1>nul 2>nul
echo %1|findstr /R "^[0-9]*$" 1>nul 2>nul && set tag=1&&goto %1||set tag=0&&goto start
:start
cls
echo 01   PDF Reader 11
echo 02   Firefox 17.0.1
echo 03   GooglePinyin 2.7.21.114
echo 04   Thunderbird 17.0
echo 05   TortoiseSVN 1.7.8
echo 06   Skype 5.5
echo 07   7-Zip 9.20
echo 08   IE 8.0
echo 09   OpenOffice 3.4.1
echo 10   StarUML 5.0
echo 11   Astah 6.4.1
echo 12   Flash Plugin 11
echo 13   PrimoPDF 5.1.0.2
echo 14   Dia 0.97
echo 15   Sqlyog 9.2.0
echo 16   Sql 2005 Client
echo 17   Filezilla 3.6.0.2
echo 18   Comodo 5.3.50343.1237
echo 19   K-lite 9.5
echo 20   FCStation v3
echo 21   Duckling 3.3
echo 22   Sqldeveloper 3.2.09.30
echo 23   Chorme 18.0.1025.45
echo 24   Spark 2.6.3
echo 25   JDK 1.7.09
echo 26   VB VC Runtime
echo 27   Xmind 3.2.1
echo 28   Notepad ++ 6.2.2
echo 29   Gant Project
echo 30   Fiddler 2
echo 31   Screen snap
echo 32   OCS NG Agent
echo 33   Wpkg Client 1.3.14
echo 34   RealVNC 4.1.3
echo 35   Office Viewer
echo 36   Development Env
echo 37   AMD Dual-Core Optimizer
echo 38   Putty 0.6
echo 39   Security Police
echo 40   IME tool
echo 41   Desktop Shortcuts 
echo 42   Proxy Setting
echo 43   Software Uninstall
echo 44   Mysql WorkBench 5.2.41
echo.
set var=
set/p var=请选择要安装的软件: 
echo %var%|findstr /R "^[0-9]*$" 1>nul 2>nul && echo. && goto %var%
if "%tag%"=="1" (exit /b) else goto start

:01
echo 正在安装 Adobe PDF Reader 11.0.0.379 ...
if exist "%ProgramFiles%\Adobe\Reader 11.0\Reader\AcroRd32.exe" (
	for /f "tokens=4" %%v in ('%BINPATH%\filever.exe /AD "%ProgramFiles%\Adobe\Reader 11.0\Reader\AcroRd32.exe"') do (
		if not "%%v" == "11.0.0.379" (
			%SRVPATH%\software\AdbeRdr11000_zh_CN.exe /silent /msi /norestart /quiet
		)
	)
) else (
	%SRVPATH%\software\AdbeRdr11000_zh_CN.exe /silent /msi /norestart /quiet
)
if "%tag%"=="1" (exit /b) else goto start

:02
echo 正在安装 Firefox 17.0.1 ...
%BINPATH%\7za.exe x -aoa %SRVPATH%\software\Mozilla.zip -o"%APPDATA%\" 1>nul
%SRVPATH%\software\FirefoxSetup17.0.1.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:03
echo 正在安装 Google pinyin 1.2.33.79 ...
%SRVPATH%\software\GooglePinyinInstaller.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:04
echo 正在安装 Thunderbird 17.0 ...
%SRVPATH%\software\ThunderbirdSetup17.0.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:05
echo 正在安装 Tortoise SVN 1.7.10 ...
reg query HKCU\Software\TortoiseSVN 2>nul 1>nul
if errorlevel 1 (
  %SRVPATH%\software\TortoiseSVN-1.7.10.23359-win32-svn-1.7.7.msi /quiet /qn /norestart
) else (
  reg delete HKCU\Software\TortoiseSVN /va /f 2>nul 1>nul
  %SRVPATH%\software\TortoiseSVN-1.7.10.23359-win32-svn-1.7.7.msi /quiet /qn /norestart
)
reg add HKCU\Software\TortoiseSVN /v CheckNewer /t REG_DWORD /d 0 /f 1>nul 2>nul
if "%tag%"=="1" (exit /b) else goto start

:06
echo 正在安装 Skype 5.5 ...
%SRVPATH%\software\SkypeSetup_5.5.0.114.msi /quiet /qn /norestart
if "%tag%"=="1" (exit /b) else goto start

:07
echo 正在安装 7zip 9.20 ...
%SRVPATH%\software\7z920.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:08
echo 正在安装 IE 8.0 ...
for /f "skip=3 tokens=3" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer" /v Version') do (
	if not "%%i" == "8.0.6001.18702" (
		%SRVPATH%\software\IE8-WindowsXP-x86-CHS.exe /quiet /update-no /norestart
	)
)
if "%tag%"=="1" (exit /b) else goto start

:09
echo 正在安装 OpenOffice 3.4.1 ...
%SRVPATH%\software\openoffice\setup.exe /quiet /norestart
if "%tag%"=="1" (exit /b) else goto start

:10
echo 正在安装 StarUML 5.0 ...
%SRVPATH%\software\staruml-5.0-with-cm.exe /verysilent /SP- /norestart
for %%i in ("C:\Program Files\StarUML\StarUML.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:11
echo 正在安装 Astah 6.4.1 ...
%SRVPATH%\software\astah-community-6_4_1-jre-setup.exe /VERYSILENT /SP- /norestart
if "%tag%"=="1" (exit /b) else goto start

:12
echo 正在安装 Flash plugin ...
%SRVPATH%\software\flash_player_11_plugin.exe -install
%SRVPATH%\software\flash_player_11_ax.exe -install
if "%tag%"=="1" (exit /b) else goto start

:13
echo 正在安装 PrimoPDF 5.1.0.2 ...
%SRVPATH%\software\Freeware_PrimoPDF.exe /Autoupdate /S /D
if "%tag%"=="1" (exit /b) else goto start

:14
echo 正在安装 Dia 0.97.1 ...
%SRVPATH%\software\dia-setup-0.97.1-2.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:15
echo 正在安装 Sqlyog 9.2.0 Community ...
%SRVPATH%\software\SQLyog-9.2.0-2Community.exe /S /D
for %%i in ("%ProgramFiles%\SQLyog Community\SQLyogCommunity.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:16
echo 正在安装 SQL 2005 Express Client ...
%SRVPATH%\software\SQLServer2005_SSMSEE.msi /quiet /norestart
for %%i in ("C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:17
echo 正在安装 Filezilla client 3.6.0.2 ...
%SRVPATH%\software\FileZilla_3.6.0.2_win32-setup.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:18
echo 正在安装 COMODO 5.3.50343.1237 ...
if not exist "%PROGRAMFILES%\COMODO\COMODO Internet Security\cfp.exe" (
  %SRVPATH%\software\cav_installer_x86.exe
)
if "%tag%"=="1" (exit /b) else goto start

:19
echo 正在安装 K-lite Codec Pack 9.5 ...
%SRVPATH%\software\K-Lite_Codec_Pack_950_Mega.exe /VERYSILENT /SP- /norestart
for %%i in ("%ProgramFiles%\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:20
echo 正在安装 财汇金融分析平台 v3 ...
%SRVPATH%\software\FCStationV3Setup.exe /verysilent /SP- /norestart
for %%i in ("%ProgramFiles%\FCStation\FCSLoader.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:21
echo 正在安装 小鸭五笔 ...
%SRVPATH%\software\DucklingWB_33.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:22
echo 正在安装 Sqldeveloper 3.2.09.30 ...
%BINPATH%\7za.exe x -aos %SRVPATH%\development\sqldeveloper-3.2.09.30.zip -o"%ProgramFiles%" 1>nul
for %%i in ("%ProgramFiles%\sqldeveloper\sqldeveloper.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:23
echo 正在安装 Chrome 18.0.1025.45 ...
%SRVPATH%\software\chrome_installer18.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:24
echo 正在安装 Spark 2.6.3 ...
%SRVPATH%\software\spark.jsvest.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:25
echo 正在安装 JDK 1.7.09 ...
%BINPATH%\7za.exe x -aos %SRVPATH%\software\jdk1.7.0_09.win32.zip -o"%ProgramFiles%" 1>nul
if exist "%ProgramFiles%\jdk1.7.0_09\" (
  %BINPATH%\nircmd.exe regdelval "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "CATALINA_HOME"
  %BINPATH%\nircmd.exe regdelval "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "ANT_HOME"
  %BINPATH%\nircmd.exe regdelval "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "TOMCAT_HOME"
  %BINPATH%\nircmd.exe regsetval sz "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "JAVA_HOME" "%ProgramFiles%\jdk1.7.0_09\" 
  %BINPATH%\nircmd.exe regsetval expand_sz "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" "%ProgramFiles%\jdk1.7.0_09\bin;%PATH%"
  %BINPATH%\nircmd.exe sysrefresh environment
)
if "%tag%"=="1" (exit /b) else goto start

:26
echo 正在安装 VB VC C# Runtime ...
%SRVPATH%\software\Runtime\VB_6.0_SP6.exe /q
%SRVPATH%\software\Runtime\vcredist_x86_2005.exe /q
%SRVPATH%\software\Runtime\Microsoft_DotNetFX_4.0_x86_x64.exe /norestart /passive
if "%tag%"=="1" (exit /b) else goto start

:27
echo 正在安装 Xmind 3.2.1 ...
%SRVPATH%\software\xmind-win-3.2.1.201011212218.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:28
echo 正在安装 Notepad ++ 6.2.2...
%SRVPATH%\software\npp.6.2.2.Installer.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:29
echo 正在安装 Ganntproject ...
%SRVPATH%\software\ganttproject-2.6-r1473.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:30
echo 正在安装 Fiddler 2 ...
%SRVPATH%\development\Fiddler2Setup.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:31
echo 正在安装 屏幕截图 ...
%SRVPATH%\software\jsvest.exe /S /D
if "%tag%"=="1" (exit /b) else goto start

:32
echo 正在安装 OCS NG Agent ...
if not exist "%programfiles%\OCS Inventory Agent\OCSInventory.exe" (
  sc config wmi start= auto 2>nul 1>nul
  %SRVPATH%\software\OCS-NG-Windows-Agent-Setup.exe
)
if "%tag%"=="1" (exit /b) else goto start

:33
echo 正在安装 wpkg客户端 ...
if not exist "%programfiles%\wpkg\WPKGSrv.exe" (
  %SRVPATH%\software\"WPKG Client 1.3.14-x32.msi"
)
if "%tag%"=="1" (exit /b) else goto start

:34
echo 正在安装 RealVNC 4.1.3...

net stop WinVNC4 1>nul 2>nul
sc delete WinVNC4 1>nul 2>nul

reg add "HKLM\SOFTWARE\RealVNC\WinVNC4" /v SecurityTypes /t REG_SZ /d VncAuth /f 1>nul
reg add "HKLM\SOFTWARE\RealVNC\WinVNC4" /v Password /t REG_SZ /d 90e857bb8194ce99 /f 1>nul

%BINPATH%\7za.exe x -aoa %SRVPATH%\software\RealVNC.zip -o"%ProgramFiles%" 1>nul
if exist "%ProgramFiles%\RealVNC\VNC4\winvnc4.exe" (       
	"%ProgramFiles%\RealVNC\VNC4\winvnc4.exe" -register 1>nul 2>nul
) else (
	echo Real VNC 安装失败 ...
)
if "%tag%"=="1" (exit /b) else goto start

:35
echo 正在安装 Word View ...
%SRVPATH%\software\wordview_zh-cn.exe /quiet /passive /norestart
echo 正在安装 PowerPoint View ...
%SRVPATH%\software\PowerPointViewer.exe /quiet /passive /norestart
echo 正在安装 Excel View ...
%SRVPATH%\software\ExcelViewer.exe /quiet /passive /norestart
echo 正在安装 Office 2007 兼容包 ...
%SRVPATH%\software\FileFormatConverters.exe /quiet /passive /norestart
%SRVPATH%\software\visioviewer.exe /quiet
echo 正在安装 PDF Convert 插件 ...
%SRVPATH%\software\SaveAsPDFandXPS.exe /quiet
for %%i in ("%ProgramFiles%\Microsoft Office\OFFICE12\XLVIEW.EXE" "%ProgramFiles%\Microsoft Office\OFFICE12\PPTVIEW.EXE" "%ProgramFiles%\Microsoft Office\OFFICE11\WORDVIEW.EXE" "%ProgramFiles%\PuTTY-v0.60\putty.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:36
echo 正在安装 开发环境 ...
if exist d: (
  %BINPATH%\7za.exe x -aos %SRVPATH%\development\Eclipse\eclipse-3.6.zip -o"D:\" 1>nul
  cacls D:\eclipse-3.6 /T /E /G users:F
  for %%i in ("D:\eclipse-3.6\eclipse\eclipse.exe") do (
    if exist "%%i" (
      %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
    )
  )
) else (
  %BINPATH%\7za.exe x -aos %SRVPATH%\development\Eclipse\eclipse-3.6.7z -o"C:\" 1>nul
  cacls C:\eclipse-3.6 /T /E /G users:F
  for %%i in ("C:\eclipse-3.6\eclipse\eclipse.exe") do (
    if exist "%%i" (
      %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
    )
  )
)
if "%tag%"=="1" (exit /b) else goto start

:37
echo 正在安装 AMD双核补丁 ...
%SRVPATH%\software\AMDSetup.exe /S /v/qn
if "%tag%"=="1" (exit /b) else goto start

:38
echo 正在安装 Putty 0.6 ...
%BINPATH%\7za.exe x -aos %SRVPATH%\development\PuTTY-v0.60.zip -o"%ProgramFiles%" 1>nul
for %%i in ("%ProgramFiles%\PuTTY-v0.60\putty.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:39
echo 正在配置 D盘User组权限 ...
if exist "D:\" (
  cacls D: /E /P USERS:F 1>nul 2>nul
) else (
  echo ERROR: 磁盘分区D未被格式化
)
echo 正在配置 注册表 ...
reg add HKLM\SOFTWARE\Microsoft\DrWatson /v AppendToLogFile /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\DrWatson /v CreateCrashDump /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\DrWatson /v WaveFile /t reg_dword /d "" /f 1>nul 2>nul
reg add HKLM\SYSTEM\ControlSet001\Control\CrashControl /v AutoReboot /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\SYSTEM\ControlSet001\Control\CrashControl /v SendAlert /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Control\CrashControl /v CrashDumpEnabled /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\PCHealth\ErrorReporting /v DoReport /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\PCHealth\ErrorReporting /v ShowUI /t reg_dword /d 0 /f 1>nul 2>nul
reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" /v ClearPageFileAtShutdown /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v dontdisplaylastusername /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters /v SMBDeviceEnabled /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v SynAttackProtect /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v restrictanonymous /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v restrictanonymoussam /t reg_dword /d 1 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareWks /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareServer /t reg_dword /d 0 /f 1>nul 2>nul
reg add "HKCU\Control Panel\Desktop" /v AutoEndTasks /t reg_sz /d 1 /f 1>nul 2>nul
reg add "HKCU\Control Panel\Desktop" /v WaitToKillAppTimeout /t reg_sz /d 1000 /f 1>nul 2>nul
reg add "HKCU\Control Panel\Desktop" /v HungAppTimeout /t reg_sz /d 500 /f 1>nul 2>nul
reg add HKLM\System\CurrentControlSet\Control /v WaitToKillServiceTimeout /t reg_sz /d 10000 /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system /v DisableCAD /t reg_dword /d 1 /f 1>nul 2>nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutdownReasonOn /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKLM\software\policies\Skype\Phone /v DisableFileTransfer /t reg_dword /d 0 /f 1>nul 2>nul
reg add HKCR\lnkfile /v IsShortcut /t REG_SZ /d "" /f 1>nul 2>nul
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoSimpleStartMenu /t REG_DWORD /d 1 /f 1>nul 2>nul
reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f 1>nul 2>nul
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v WebView /t REG_DWORD /d 0 /f 1>nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v Link /t REG_BINARY /d "18000000" /f 1>nul 2>nul
regsvr32 /u /s igfxpph.dll 1>nul 2>nul
rem 设置桌面背景为空
reg delete HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers /f 1>nul 2>nul
reg add HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\new /ve /d {D969A300-E7FF-11d0-A93B-00A0C90F2719} 1>nul 2>nul
rem 设置默认首页
reg add "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://g.cn" /f 1>nul 2>nul
reg add "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel" /v "HOMEPAGE" /t REG_DWORD /d 1 /f 1>nul 2>nul
reg add "HKLM\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://g.cn" /f 1>nul 2>nul
rem 添加CMD至目录
reg add HKCR\folder\shell\cmd /ve /t REG_SZ /d "CMD" /f 1>nul 2>nul
reg add HKCR\folder\shell\cmd\command /ve /t REG_SZ /d "cmd.exe /k cd %%l" /f 1>nul 2>nul
::设置时间同步服务器
net start w32time 1>nul 2>nul
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /va /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /ve /d "0" /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v 0 /t REG_SZ /d "192.168.1.21" /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v 1 /t REG_SZ /d "210.72.145.44" /f 1>nul 2>nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v 1 /t REG_SZ /d "time.windows.com" /f 1>nul 2>nul
::清理
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v report /f

::优化系统服务
echo 正在配置 系统服务 ...
:: sc config WZCSVC start= disabled 2>nul
sc config w32time start= auto 2>nul 1>nul
:sc config LmHosts start= disabled 2>nul 1>nul
sc config helpsvc start= disabled 2>nul 1>nul
sc config wuauserv start= disabled 2>nul 1>nul
sc config Messenger start= disabled 2>nul 1>nul
sc config NVSvc start= disabled 2>nul 1>nul
sc config remoteRegistry start= disabled 2>nul 1>nul
sc config wscsvc start= disabled 2>nul 1>nul
sc config ShellHWDetection start= disabled 2>nul 1>nul
sc config SSDPSRV start= disabled 2>nul 1>nul
sc config srservice start= disabled 2>nul 1>nul
sc config TlntSvr start= disabled 2>nul 1>nul
sc config srservice start= disabled 2>nul 1>nul
sc config Dot3svc start= auto 2>nul 1>nul
sc config WebClient start= disabled 2>nul 1>nul
sc config EventSystem start= disabled 2>nul 1>nul
sc config TrkWks start= disabled 2>nul 1>nul
sc config ERSvc start= disabled 2>nul 1>nul
sc config CryptSvc start= disabled 2>nul 1>nul
sc config Wmi start= disabled 2>nul 1>nul
sc config SENS start= disabled 2>nul 1>nul
sc config NVSvc start= disabled 2>nul 1>nul
sc config JavaQuickStarterService start= disabled 2>nul 1>nul
sc config Alerter start= disabled 2>nul 1>nul
sc config CiSvc start= demand 2>nul 1>nul
sc config sharedaccess start= disabled 2>nul 1>nul
sc config gupdate start= disabled 2>nul 1>nul
sc config gupdatm start= disabled 2>nul 1>nul
sc config "Norton Internet Security" start= disabled 2>nul 1>nul
:: Disabled Intel Wireless
sc config WLANKEEPER start= disabled 2>nul 1>nul
sc config EvtEng start= disabled 2>nul 1>nul
sc config RegSrvc start= disabled 2>nul 1>nul
sc config S24EventMonitor start= disabled 2>nul 1>nul
sc config PolicyAgent start= auto 2>nul 1>nul
sc config schedule start= auto 2>nul 1>nul
net stop sharedaccess 2>nul 1>nul
if "%tag%"=="1" (exit /b) else goto start

:40
echo 正在配置 输入法 ...
%BINPATH%\IMETool.exe /add3:E0200804 /add3:E0210804 /del4:E0040804 /del4:E0030804 /del4:E0010804 /del4:E00E0804
if "%tag%"=="1" (exit /b) else goto start

:41
echo 正在配置 桌面快捷方式 ...
del /q /f "%ALLUSERSPROFILE%\桌面\Oracle Database 10g Express Edition 入门.lnk" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\背单词.lnk" 1>nul 2>nul
del /q /f "%USERPROFILE%\桌面\帮助和支持.lnk" 1>nul 2>nul
del /q /f "%USERPROFILE%\桌面\Windows Media Player.lnk" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\Mozilla Firefox.lnk" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\Mozilla Thunderbird.lnk" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\谷歌金山词霸合作版2.0.lnk" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\PrimoPDF*" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\桌面\财汇金融分析平台*" 1>nul 2>nul
del /q /f "%ALLUSERSPROFILE%\「开始」菜单\程序\Windows Messenger.lnk" 1>nul 2>nul
for %%i in ("%ProgramFiles%\XMind\xmind.exe" "D:\eclipse-3.6\eclipse\eclipse.exe" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe" "%ProgramFiles%\StarUML\StarUML.exe" "%userprofile%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" "%ProgramFiles%\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe" "%ProgramFiles%\Microsoft Office\OFFICE12\EXCEL.EXE" "%ProgramFiles%\Microsoft Office\OFFICE12\WINWORD.EXE" "%ProgramFiles%\Microsoft Office\OFFICE12\POWERPNT.EXE" "%ProgramFiles%\sqldeveloper\sqldeveloper.exe" "%ProgramFiles%\Microsoft Office\OFFICE12\XLVIEW.EXE" "%ProgramFiles%\Microsoft Office\OFFICE12\PPTVIEW.EXE" "%ProgramFiles%\Microsoft Office\OFFICE11\WORDVIEW.EXE" "%ProgramFiles%\Mozilla Firefox\firefox.exe" "%ProgramFiles%\Mozilla Thunderbird\thunderbird.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start

:42
echo 正在配置 IE代理 ...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t reg_dword /d 1 /f 1>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t reg_SZ /d proxy.jsw.office:3128 /f 1>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t reg_SZ /d "192.168.*;.jsw.office;localhost;127.0.0.1" /f 1>nul
%BINPATH%\nircmd.exe sysrefresh
if "%tag%"=="1" (exit /b) else goto start

:43
echo 正在清理 部份软件 ...
if exist "%ProgramFiles%\Messenger" rd /q /s "C:\Program Files\Messenger" 1>nul 2>nul
for /f "tokens=2,3,4 delims=|" %%i in ('%BINPATH%\uins.exe') do (
  set var=%%j
  for %%a in ("有道工具栏" "有道桌面词典" "360保险箱" "360安全卫士") do (
      if %%a=="%%i" (%%j /S)
  )
  for %%b in ("Windows Live 软件包" "Windows Live 上载工具" "Windows Live 照片库" "Windows Live Toolbar" "Windows Live Writer" "Windows Live Sync" "Windows Live 登录助手" "Windows Live Mail" "Windows Live Communications Platform" "Windows Live Messenger" "Skype web features" "Skype(TM) 4.1") do (
      if %%b=="%%i" (
        set var1=%%j
        ::echo %%i !var1:~0,11! /X!var1:~14! /quiet
        MsiExec.exe /X!var1:~14! /quiet
      )
  )
)
if "%tag%"=="1" (exit /b) else goto start

:44
echo 正在安装 Mysql Workbench 5.2.41 ...
%BINPATH%\7za.exe x -aos %SRVPATH%\development\mysql-workbench-gpl-5.2.41-win32-noinstall.zip -o"%ProgramFiles%" 1>nul
for %%i in ("%ProgramFiles%\MySQL Workbench 5.2.41 CE\MySQLWorkbench.exe") do (
  if exist "%%i" (
    %BINPATH%\nircmd.exe shortcut %%i "~$folder.desktop$" "%%~ni"
  )
)
if "%tag%"=="1" (exit /b) else goto start


另外弄个脚本比如,即可批量安装指定的软件:

for %%i in (01 02 03 04 05 07 08 09 10 11 12 13 14 15 16 18 20 22 23 24 25 26 27 28 29 30 31 32 34 35 37 39 40 41 42 43 44) do (
    call common.bat %%i
)


你可能感兴趣的:(windows 批量软件安装脚本)