Bat ·

bat一键封装 Win7SP1系统

下面这个cmd命令是运维天涯博主为自己电脑封装系统.同时也帮忙安装在公司同事电脑上,相信大家也可以为自己的电脑制作一个,纯洁,安全,可靠的 windows 7 系统

@echo off
title=自动安装整合 Windows 7 旗舰版
MODE CON: COLS=76 LINES=50
set tm1=%time:~0,2%
set tm2=%time:~3,2%
set tm3=%time:~6,2%
color 0A
:start
cls
echo.
echo        **********自动安装 Windows 7 旗舰版 **********
echo.
echo                    现在时间是:%date% %tm1%点%TM2%分%TM3%秒
echo         ╭───────────────────────────╮
echo    ╭─┤         Windows 7 旗舰版高危补丁自动安装程序        ├──╮
echo   │   ╰────────────────────────────╯     │
echo   │    本程序能自动安装  Windows 7 旗舰版系统高危漏洞补丁              │
echo   │                                                                    │
echo   │         制作: 运维天涯  QQ:2016571396   2019年10月1日              │
echo   ╰──────────────────────────────────╯
color 0E
setlocal EnableDelayedExpansion
set a=0
set b=0

REM ################################################################
set DriveU=C:
rem 封装好路径
set setupwim=%DriveU%\Sources
set imgjpg=E:\Win2012R2\C_Win2012\Windows\Web\Wallpaper\Windows
rem install.wim解压安装映像路径
set Wim_Dir=%setupwim%\Win7_64
rem 补丁路径
set buding=E:\Win2012R2\Win7_X64_Updata
rem 源install.wim原版文件路径
set Source_Dir=D:\Sources\WIM\install_Win7.wim
rem 导出第4个映像路径
set install_wim=C:\Win7.wim

IF NOT EXIST "%Wim_Dir%" (
MD "%Wim_Dir%">nul
)

rem 显示WIM文件映像信息
DISM /Get-WimInfo /WimFile:%Source_Dir%
ECHO.

ECHO 删除映像 家庭普通版(1) 家庭高级版(2)

echo 导出映像中第4个 数据中心版
DISM /Export-Image /SourceImageFile:%Source_Dir% /SourceIndex:4 /DestinationImageFile:%install_wim%
echo.
echo 01
echo 装载(Mount)映像以可写方式加载install.wim的映像4(即数据中心版映像编号)
echo 到%Wim_Dir%目录(F盘要为NTFS格式),index索引数值 装载 Windows 映像到 %Wim_Dir% 目录
rem dism /mount-image /imageFile:E:\Win2012R2\install2012.wim /index:1 /mountdir:E:\Win2012R2\Win2012_R2
dism /mount-image /imageFile:%install_wim% /index:1 /mountdir:%Wim_Dir%
echo.
echo.
echo 02 设置安装的脱机映像中使用的默认系统用户界面语言
rem dism /image:E:\Win2012R2\Win2012_R2 /Set-UILang:zh-cn
dism /image:%Wim_Dir% /Set-UILang:zh-cn
echo.
echo.
echo 03 区域语言:
rem dism /image:%Wim_Dir% /Set-SysLocale:zh-cn
dism /image:%Wim_Dir% /Set-SysLocale:zh-cn
echo.
echo.
echo 04 用户语言:
rem dism /image:E:\Win2012R2\Win2012_R2 /Set-UserLocale:zh-cn
dism /image:%Wim_Dir% /Set-UserLocale:zh-cn
echo.
echo.
echo 05 默认语言设置为中文区域ID:
dism /image:%Wim_Dir% /set-inputlocale:0804:00000804
Dism /image:%Wim_Dir% /Set-AllIntl:zh-cn
Dism /image:%Wim_Dir% /Set-InputLocale:042d:0000040a
Dism /image:%Wim_Dir% /Set-InputLocale:0411:{03B5835F-F03C-411B-9CE2-AA23E1171E36}{A76C93D9-5523-4E90-AAFA-4DB112F9AC76}
echo.
echo.
echo.
echo 可以关闭窗口 下面是整合IE11

rem 获取 功能名称
rem dism /image:%Wim_Dir% /get-features

rem 获取 功能名称
rem dism /online /get-features
rem 启用win7自带的.net framework 3.5.1(功能名称区分大小写)
rem dism /online /enable-feature /featurename:NetFx3
rem 禁用win7自带的.net framework 3.5.1
rem dism /online /disable-feature /featurename:NetFx3

echo 7
rem 启用win7自带的.net framework 3.5.1(功能名称区分大小写)
Dism /Image:%Wim_Dir% /enable-feature /featurename:NetFx3
echo 8
Dism /Image:%Wim_Dir% /enable-feature /featurename:TelnetClient
echo 09 小工具
Dism /Image:%Wim_Dir% /disable-feature /featurename:WindowsGadgetPlatform
echo 10 游戏
Dism /Image:%Wim_Dir% /enable-feature /featurename:InboxGames
echo 11
Dism /Image:%Wim_Dir% /disable-feature /featurename:Chess
echo 12
Dism /Image:%Wim_Dir% /disable-feature /featurename:Hearts
echo 13
Dism /Image:%Wim_Dir% /disable-feature /featurename:FreeCell
echo 14
Dism /Image:%Wim_Dir% /disable-feature /featurename:"Internet Games"
echo 15
Dism /Image:%Wim_Dir% /disable-feature /featurename:"More Games"
echo 16
Dism /Image:%Wim_Dir% /disable-feature /featurename:"Internet Backgammon"
echo 17
Dism /Image:%Wim_Dir% /disable-feature /featurename:"Internet Checkers"
echo 18
Dism /Image:%Wim_Dir% /disable-feature /featurename:"Internet Spades"
echo 19
Dism /Image:%Wim_Dir% /disable-feature /featurename:Minesweeper
echo 20
Dism /Image:%Wim_Dir% /disable-feature /featurename:More Games"
echo 21
Dism /Image:%Wim_Dir% /disable-feature /featurename:PurblePlace
echo 22
Dism /Image:%Wim_Dir% /disable-feature /featurename:Shanghai
echo 23
Dism /Image:%Wim_Dir% /disable-feature /featurename:Solitaire
echo 24
Dism /Image:%Wim_Dir% /disable-feature /featurename:SpiderSolitaire
echo 25 TabletPCOC 组件
Dism /Image:%Wim_Dir% /disable-feature /featurename:TabletPCOC

rem /将KB2670838更新程序脱机添加到e:\wim文件夹
dism /image:%Wim_Dir% /add-package /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64\Windows6.1-KB2670838-x64.msu

rem //将IE-Win7.cab和ielangpack-zh-CN.CAB这两个组件添加到e:\wim文件夹中。
dism /image:%Wim_Dir% /add-package /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64\IE-Win7.CAB /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64\ielangpack-zh-CN.CAB


rem //将IE11的系统环境组件、拼写功能组件:IE-Hyphenation-en.MSU、IE-Spelling-en.MS添加到e:\wim文件夹中。
dism /image:%Wim_Dir% /add-package /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64\IE-Hyphenation-en.MSU /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64\IE-Spelling-en.MSU

rem //将IE11.0.3升级补丁KB2932269加入E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64文件夹
rem dism /image:%Wim_Dir% /add-package /packagepath:E:\Win2012R2\Win7_X64_Updata\Win7_IE11_64-Windows6.1-KB2932269-x64.msu

echo 下面是更新补丁, 补丁可以用其它工具下载,补丁文件名存放在 fooher.dat 里,一行一个
echo.
for /f %%i in (fooher.dat) do set /a a+=1
for /f %%j in (fooher.dat) do (
set /a b+=1
echo.
echo 正在安装%%j更新(第!b!个更新,共%a%个更新)
Dism /Image:%Wim_Dir% /Add-Package /PackagePath:"%buding%\%%j"
)

echo.
ECHO 卸载并保存已经整合补丁的"install.wim"
echo.
echo 想好还有什么事没有做,所以这里先暂停一下
rem  Dism /Unmount-WIM /MountDir:C:\Sources\Win7_64 /Commit
echo.
ECHO 将无人参与文件应用于映像
echo.
rem DISM /Image:C:\Sources\Win7_64 /Apply-Unattend:E:\Win2012R2\unattend.xml
rem DISM /commit-image /MountDir:%Wim_Dir%
Dism /Unmount-WIM /MountDir:%Wim_Dir% /Commit
REM 打包成ISO镜像
REM oscdimg.exe -m -o -u2 -udfver102 -lHRM_CCSA_X64FRE_ZH-CN_DV5 -bootdata:2#p0,e,bF:\win8x64\boot\etfsboot.com#pEF,e,bF:\win8x64\efi\microsoft\boot\efisys.bin F:\win8x64\ F:\WIN8_X64_201306.ISO -o –m

echo 更新补丁完成,按任意键退出!
pause
pause
pause>nul&exit

 

评论已关闭