无忧启动论坛

标题: Wim镜像维护...... [打印本页]

作者: oym2016    时间: 2023-12-4 17:38
标题: Wim镜像维护......
本帖最后由 oym2016 于 2023-12-6 23:51 编辑

借用本论坛某大师PE镜像中的MountWim批处理学习 学习.....
在PC上用右键方式 处理PEWIM镜像比较方便 ...

MountWin.cmd
@echo off&PUSHD "%~dp0"
setlocal enabledelayedexpansion
set wim=%1
call :FindMountPoint 1%
if "!folder!"=="" (
     if not exist %~dpn1 md %~dpn1 2>nul
     call :ChoiseIndex %1
     DISM.exe /Mount-Image /ImageFile:%1 /index:!index! /MountDir:%~dpn1\
     ) else (
     call :ChoiseIndex %1
     echo.&set/p user_select= Save image input: "y"  ;  discard changes: "Enter key"
     if !user_select! equ y (set NL=Commit) else (set NL=discard)
     DISM.exe /Unmount-Image /MountDir:%~dpn1\ /!NL!
     rd /q "%~dpn1\" 1>nul 2>nul
     if !user_select! equ y (%~dp0bin\wimlib-imagex.exe optimize %1 --check )
     )
pause
exit
:ChoiseIndex
  set maxIndex=1
  for /f "tokens=2 eol=; delims=: " %%i in ('DISM /Get-ImageInfo /ImageFile:%1') do (
    for %%a in (1 2) do (
      if "%%i"=="%%a" set maxIndex=%%i
    )
  )
  if not "!maxIndex!"=="1" (
    @DISM /Get-WimInfo /WimFile:%1
    @echo.
    set /p index=ÇëÑ¡ÔñWimÓ³ÏñµÄË÷Òý:
  ) else (
    set index=1
  )
goto :eof

:FindMountPoint
  for /f "tokens=2 eol=; delims= " %%i in ('DISM.exe /Get-MountedImageInfo') do (
    if /i "%%i"=="%1" (
      set folder=!value!
    ) else (
      set value=%%i
    )
  )
goto :eof

WimBootCD.CMD
@echo off&PUSHD %~dp0
setlocal enabledelayedexpansion
set wim=%1
for /f %%i in ('date /t') do set datevar=%%i
  call :ChoiseIndex %1
  Dism.exe /Export-Image /SourceImageFile:%1 /SourceIndex:!index! /DestinationImageFile:".\iso\Sources\boot.wim" /Compress:maximum /CheckIntegrity /Bootable
  "%~dp0bin\oscdimg.exe" -m -o -u2 -udfver102 -l%datevar% -bootdata:2#p0,e,b"%~dp0bin\etfsboot.com"#pEF,e,b"%~dp0bin\efisys.bin" ".\iso" %~dpn1.iso
pause
@echo clear Wim...
del /s /Q  ".\iso\Sources\boot.wim" >nul
exit

:ChoiseIndex
  set maxIndex=1
  for /f "tokens=2 eol=; delims=: " %%i in ('DISM /Get-WimInfo /WimFile:%1') do (
    for %%a in (1 2) do (
      if "%%i"=="%%a" set maxIndex=%%i
    )
  )
  if not "!maxIndex!"=="1" (
    @DISM /Get-WimInfo /WimFile:%1
    @echo.
    set /p index=Please select the index number:
  ) else (
    set index=1
  )
goto :eof




Screenshot 2023-12-06 200728.png (37.7 KB, 下载次数: 58)

直接拖放在...就行了

直接拖放在...就行了

作者: 车厘子    时间: 2023-12-4 17:53
抢占沙发
作者: yyz2191958    时间: 2023-12-4 18:07
谢谢分享
作者: yyz2191958    时间: 2023-12-4 18:21
我不晓得怎么使用
作者: yc2428    时间: 2023-12-4 19:00
谢谢分享
作者: 53543388    时间: 2023-12-4 19:11

谢谢分享
作者: haseem725s    时间: 2023-12-4 19:14
凡是我看不懂的我都赞!
作者: oym2016    时间: 2023-12-4 19:24
本帖最后由 oym2016 于 2023-12-4 19:50 编辑
yyz2191958 发表于 2023-12-4 18:21
我不晓得怎么使用

晕 忘记修改Wim_Tools_reg.cmd中的路径了
修改后再贴
作者: yyz2191958    时间: 2023-12-4 19:25
oym2016 发表于 2023-12-4 19:24
晕 忘记修改Wim_Tools_reg.cmd中的路径了
重贴一下

辛苦了 谢谢
作者: 2012心落尘埃    时间: 2023-12-4 19:42

凡是我看不懂的我都赞!
作者: tanglf    时间: 2023-12-4 19:58
感谢楼主
作者: promrhxq    时间: 2023-12-4 22:38
感谢分享好东东
作者: nathan6498    时间: 2023-12-4 23:59
谢谢分享
作者: CQgaxm    时间: 2023-12-5 06:54
感谢分享
作者: AcidBurn    时间: 2023-12-5 07:09
谢谢分享
作者: oh312    时间: 2023-12-5 07:16
赞,谢谢分享。
作者: iaanqrm    时间: 2023-12-5 09:48

作者: fegr    时间: 2023-12-5 13:10
感谢分享
作者: kevin2023    时间: 2023-12-5 16:30
Wim镜像
作者: 恶魔旋律    时间: 2023-12-5 17:09
感谢分享
作者: zpwz    时间: 2023-12-8 14:11
谢谢分享
作者: zxb415    时间: 2024-1-5 06:10
感谢分享
作者: zxb415    时间: 2024-1-9 20:27
谢谢分享
作者: 2012fang_song    时间: 2024-1-10 08:26
运行出错:
错误: 740
需要提升权限才能运行 DISM。
使用提升的命令提示符完成这些任务。
请按任意键继续. . .
作者: reninhouse    时间: 2024-1-10 13:48
不明觉厉
作者: dylan9247    时间: 2024-1-10 17:47
谢谢楼主分享
作者: 无犹启动    时间: 2024-2-4 08:32
谢谢分享
作者: xiaolumuyu    时间: 2024-2-12 15:41
感谢分享
作者: dyc086    时间: 2024-2-13 20:13
谢谢分享
作者: wang1126    时间: 2024-2-17 14:07
谢谢分享




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3