|
本帖最后由 550 于 2020-11-24 00:31 编辑
@echo off
title 应用映像
mode con cols=62 lines=7&color 0b
cd /d "%~dp0"
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
echo.
echo; 确定要解压E:光盘PE的 boot.wim 到 d:\a ?
echo.
echo.
echo; 按任意键确定 反之按关闭按钮
echo.
pause >nul
rem 将所有文件/目录的所有者更换到 administrators 组,还有将 DACL 权限设置为可继承,而 SACL 权限则不变。
setacl.exe -on "d:\a" -ot file -actn setprot -op "dacl:np;sacl:nc" -rec cont_obj -actn setowner -ownr "n:S-1-5-32-544;s:y" >nul 2>nul
cls
echo.
echo.
echo.
echo 权限已更新 按任意键将删除 d:\a 和 boot.wim 反之按关闭按钮
echo.
echo.
rem pause>nul
cls
rd /s /q "d:\a" >nul 2>nul
del "d:\boot.wim" >nul 2>nul
md "d:\a" >nul 2>nul
echo.
echo.
echo d:\a 和 boot.wim 已删除成功 可重新解压 win 本次操作继续...
echo.
echo.
echo.
rem pause>nul
cls
Dism /apply-image /imagefile:D:\WimBuilder2-Full.v2020-11-11\_Factory_\target\WIN10XPE\build\boot.wim /index:1 /ApplyDir:d:\a\
cls
if exist "d:\a\Program Files (x86)" goto x64
echo.
echo; 确定要移植 winre_x86 到 d:\a 吗?
echo.
echo; 按任意键确定 反之按关闭按钮
echo.
rem pause >nul
rd /s /q "d:\a\PEMaterial\BYtools"
XCOPY "%~dp0winre_x86\PEMaterial\BYtools\*" "d:\a\PEMaterial\BYtools\" /s /h /y
rem 拷贝计算器
echo f|xCOPY "%~dp0winre_x86\Windows\System32\calc.exe" "d:\a\Windows\System32\calc.exe" /y
echo f|xCOPY "%~dp0winre_x86\Windows\System32\zh-CN\calc.exe.mui" "d:\a\Windows\System32\zh-CN\calc.exe.mui" /y
rem 拷贝桌面快捷键
echo f|xCOPY "%~dp0winre_x86\Users\Public\Desktop\*.lnk" "d:\a\Users\Public\Desktop\" /y
echo f|xCOPY "%~dp0winre_x86\PEMaterial\PEStartup.bat" "d:\a\PEMaterial\" /y
echo f|xCOPY "%~dp0winre_x64\PEMaterial\Autoruns\PEStartupMain.bat" "d:\a\PEMaterial\Autoruns\" /y
rem 拷贝程序快捷键
XCOPY "%~dp0winre_x86\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\*" "d:\a\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\" /s /h /y
rem 替换自带的7z
rd /s /q "d:\a\Program Files\7-Zip"
XCOPY "%~dp0winre_x86\Program Files\7-Zip\*" "d:\a\Program Files\7-Zip\" /s /h /y
goto db
:x64
cls
echo.
echo; 确定要移植 winre_x64 到 d:\a 吗?
echo.
echo; 按任意键确定 反之按关闭按钮
echo.
rem pause >nul
rd /s /q "d:\a\PEMaterial\BYtools"
XCOPY "%~dp0winre_x64\PEMaterial\BYtools\*" "d:\a\PEMaterial\BYtools\" /s /h /y
rem 拷贝计算器
echo f|xCOPY "%~dp0winre_x64\Windows\System32\calc.exe" "d:\a\Windows\System32\calc.exe" /y
echo f|xCOPY "%~dp0winre_x64\Windows\System32\zh-CN\calc.exe.mui" "d:\a\Windows\System32\zh-CN\calc.exe.mui" /y
echo f|xCOPY "%~dp0winre_x64\Windows\SysWOW64\calc.exe" "d:\a\Windows\SysWOW64\calc.exe" /y
echo f|xCOPY "%~dp0winre_x64\Windows\SysWOW64\zh-CN\calc.exe.mui" "d:\a\Windows\SysWOW64\zh-CN\calc.exe.mui" /y
rem 拷贝桌面快捷键
echo f|xCOPY "%~dp0winre_x64\Users\Public\Desktop\*.lnk" "d:\a\Users\Public\Desktop\" /y
echo f|xCOPY "%~dp0winre_x64\PEMaterial\PEStartup.bat" "d:\a\PEMaterial\" /y
echo f|xCOPY "%~dp0winre_x64\PEMaterial\Autoruns\PEStartupMain.bat" "d:\a\PEMaterial\Autoruns\" /y
rem 拷贝程序快捷键
XCOPY "%~dp0winre_x64\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\*" "d:\a\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\" /s /h /y
rem 替换自带的7z
rd /s /q "d:\a\Program Files\7-Zip"
XCOPY "%~dp0winre_x64\Program Files\7-Zip\*" "d:\a\Program Files\7-Zip\" /s /h /y
:db
cls
echo.
echo; 确定要打包 d:\a 到 d:\boot.wim 吗?
echo.
echo.
echo; 按任意键确定 反之按关闭按钮
echo.
rem pause >nul
del "d:\boot.wim" >nul 2>nul
cls
Dism /Capture-Image /ImageFile:d:\boot.wim /CaptureDir:d:\a\ /Name:BOOT /Compress:max /Bootable /Verify
cls
echo.
echo.
echo.
echo; 操作完成 按任意键结束
echo.
echo.
start "提示" cmd /c "mode con cols=40 lines=3&color 0a &&echo.&echo. 操作完成 2019-10-23&ping/n 2 127.1>nul"
exit
这是我的完整的植入过程可是每次都需要先解压,我想利用构建过程的那个“D:\WimBuilder2-Full.v2020-11-11\_Factory_\target\WIN10XPE\mounted”,这样效率提高不少。可少次解压过程。请问如何不让mounted里面的内容自动删除呢.
PS:最近固态的写入量,突飞猛进。
|
|