1. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    258
    152
    10
    #22162 正义羊, Feb 23, 2022
    Last edited: Feb 24, 2022
    @inTerActionVRI , @MSMG ,

    Resolved an issue where Toolkit could not execute diskpart references.

    In Toolkit, there is a known issue like this:

    - Windows 10 v1709/v1803/v1809/v1903/v1909/v2004/v20H2/v21H1/v21H2, Windows 11 v21H2 - It has been reported that in the Format USB function, the diskpart command "list" is not working when used within the script.

    In order to solve this problem, the path variable used in this part of the work has been changed, and a new variable DiskTemp has been set.

    Code:
    set "DiskTemp=C:"
    Toolkit section changed the reference variable for this section from %Temp% to reference the new %DiskTemp% independent variable.

    Tested after the change, things like formatting and listing disks worked fine, no longer unhealthy.

    In Simplified Chinese Editions of Windows, I made changes like:

    Code:
    if "%HostLanguage%" equ "zh-CN" echo.  卷 #      盘符   标签       文件系统  类型        大小    状态       信息>> "%DiskTemp%\DiskList.txt"
    The changed code is as follows, where the description and display text are localized:

    Code:
    ::-------------------------------------------------------------------------------------------
    :: 格式化 USB 闪存驱动器模组
    ::-------------------------------------------------------------------------------------------
    :FormatUSB
    
    setlocal
    
    set USBDriveLetter=
    set USBDriveLabel=
    
    cls
    echo.===============================================================================
    echo.                    MSMG 工具箱 - 格式化 USB 闪存驱动器
    echo.===============================================================================
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####正在开始格式化 USB 闪存驱动器##############################################
    echo.-------------------------------------------------------------------------------
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####正在获取 USB 闪存驱动器选项################################################
    echo.-------------------------------------------------------------------------------
    echo.
    :: 显示可用的 USB 闪存驱动器。
    echo.正在列出可用的 USB 闪存驱动器……
    call :ListDisks
    
    :: 获取 USB 闪存驱动器盘符
    set /p USBDriveLetter=请输入 USB 闪存驱动器盘符 :
    echo.
    
    :: 设置 USB 闪存驱动器盘符
    set "USBDriveLetter=%USBDriveLetter%:"
    
    :: 检查指定的 USB 闪存驱动器是否存在
    cd /d %USBDriveLetter% 2>nul
    if errorlevel 1 (
        echo.指定的 USB 闪存驱动器无效,请再次尝试……
        goto :Stop
    )
    
    :: 获取 USB 闪存驱动器卷标。
    set /p USBDriveLabel=请输入 USB 闪存驱动器的卷标:
    echo.
    
    :: 获取 USB 引导类型(UEFI/BIOS/所有)。
    choice /C:12 /N /M "请输入 USB 闪存驱动器的启动类型 [1=BIOS,2=BIOS/UEFI] :"
    if errorlevel 2 goto :BIOS_UEFI
    if errorlevel 1 goto :BIOS
    
    :: 格式化 USB 闪存驱动器为 NTFS 格式,可用于 BIOS 引导系统。
    :BIOS
        echo.
        choice /C:YN /N /M "你确定要格式化 [%USBDriveLetter%] 吗? [是‘Y’/否‘N’] :"
        if errorlevel 2 (
            echo.
            echo.格式化 USB 闪存驱动器 [%USBDriveLetter%] 已取消……
            echo.
            echo.-------------------------------------------------------------------------------
            echo.####格式化 USB 闪存驱动器已停止################################################
            echo.-------------------------------------------------------------------------------
            goto :Stop
        )
        if errorlevel 1 (
            call :FormatDisk %USBDriveLetter%, NTFS, %USBDriveLabel%
            echo.
            echo.-------------------------------------------------------------------------------
            echo.####格式化 USB 闪存驱动器已完成################################################
            echo.-------------------------------------------------------------------------------
            goto :Stop
        )
    
    :: 格式化 USB 闪存驱动器为 FAT32 格式,可用于 BIOS 和/或 UEFI 引导系统。
    :BIOS_UEFI
        echo.
        choice /C:YN /N /M "你确定要格式化 [%USBDriveLetter%] 吗? [是‘Y’/否‘N’] :"
        if errorlevel 2 (
            echo.
            echo.格式化 USB 闪存驱动器 [%USBDriveLetter%] 已取消……
            echo.
            echo.-------------------------------------------------------------------------------
            echo.####格式化 USB 闪存驱动器已停止################################################
            echo.-------------------------------------------------------------------------------
            goto :Stop
        )
        if errorlevel 1 (
            call :FormatDisk %USBDriveLetter%, FAT32, %USBDriveLabel%
            echo.
            echo.-------------------------------------------------------------------------------
            echo.####格式化 USB 闪存驱动器已完成################################################
            echo.-------------------------------------------------------------------------------
            goto :Stop
        )
    
    :Stop
    echo.
    echo.===============================================================================
    echo.
    pause
    
    set USBDriveLetter=
    set USBDriveLabel=
    
    endlocal
    
    :: 返回到主菜单
    goto :MainMenu
    ::-------------------------------------------------------------------------------------------
    
    ::-------------------------------------------------------------------------------------------
    :: 列出所有磁盘和卷模组
    ::-------------------------------------------------------------------------------------------
    :ListDisks
    
    call :RemoveFile "%DiskTemp%\DiskList.txt"
    call :RemoveFile "%DiskTemp%\DiskList1.txt"
    
    echo.list volume>> "%DiskTemp%\DiskList.txt"
    diskpart /s "%DiskTemp%\DiskList.txt" >> "%DiskTemp%\DiskList1.txt"
    call :RemoveFile "%DiskTemp%\DiskList.txt"
    echo.>> "%DiskTemp%\DiskList.txt"
    
    echo.===============================================================================>> "%DiskTemp%\DiskList.txt"
    if "%HostLanguage%" equ "en-US" echo.  Volume #  Letter Label      file Sys Type         Size    Status     Info>> "%DiskTemp%\DiskList.txt"
    if "%HostLanguage%" equ "zh-CN" echo.  卷 #      盘符   标签       文件系统  类型        大小    状态       信息>> "%DiskTemp%\DiskList.txt"
    echo.------------------------------------------------------------------------------->> "%DiskTemp%\DiskList.txt"
    if "%HostLanguage%" equ "en-US" findstr "Removable" "%DiskTemp%\DiskList1.txt" >> "%DiskTemp%\DiskList.txt"
    if "%HostLanguage%" equ "zh-CN" findstr "可移动" "%DiskTemp%\DiskList1.txt" >> "%DiskTemp%\DiskList.txt"
    echo.===============================================================================>> "%DiskTemp%\DiskList.txt"
    
    type "%DiskTemp%\DiskList.txt"
    call :RemoveFile "%DiskTemp%\DiskList.txt"
    call :RemoveFile "%DiskTemp%\DiskList1.txt"
    echo.
    
    goto :eof
    ::-------------------------------------------------------------------------------------------
    
    ::-------------------------------------------------------------------------------------------
    :: 格式化硬盘/卷模组
    :: 输入参数 [ %~1 :USB 盘符、%~2 :格式类型、%~3 :卷标]
    ::-------------------------------------------------------------------------------------------
    :FormatDisk
    
    :: 写入 DiskPart.txt 脚本文件。
    call :RemoveFile "%DiskTemp%\DiskPart.txt"
    echo.select volume ^%~1>> "%DiskTemp%\DiskPart.txt"
    echo.clean>> "%DiskTemp%\DiskPart.txt"
    echo.create partition primary>> "%DiskTemp%\DiskPart.txt"
    echo.select partition ^1>> "%DiskTemp%\DiskPart.txt"
    echo.active>> "%DiskTemp%\DiskPart.txt"
    echo.format fs=%~2 quick label=%~3>> "%DiskTemp%\DiskPart.txt"
    echo.exit>> "%DiskTemp%\DiskPart.txt"
    echo.exit>> "%DiskTemp%\DiskPart.txt"
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####正在格式化 USB 闪存驱动器##################################################
    echo.-------------------------------------------------------------------------------
    echo.
    :: 使用 Diskpart 执行 DiskPart.txt 脚本文件。
    echo.正在格式化 USB 闪存驱动器 [%~1] 为 %~2 格式,请稍等……
    start /B /wait diskpart /s "%DiskTemp%\DiskPart.txt" >nul
    echo.
    echo.格式化 USB 闪存驱动器 [%~1] 为 %~2 格式,完成……
    call :RemoveFile "%DiskTemp%\DiskPart.txt"
    
    goto :eof
    ::-------------------------------------------------------------------------------------------
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,894
    10,735
    240
    #22163 Tiger-1, Feb 23, 2022
    Last edited: Mar 6, 2022
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. xCyBx

    xCyBx MDL Senior Member

    Aug 6, 2018
    356
    718
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. chev7

    chev7 MDL Novice

    Dec 7, 2019
    22
    2
    0
    Hello. when will the new version of the program be available?
     
  5. bobbintb

    bobbintb MDL Novice

    Oct 10, 2008
    10
    0
    0
    I'm having the same issue, but a different ISO. I've tried 12.0 as well. Not sure why I am missing the option.
     
  6. very very soon. be patient pl.
     
  7. GeorgePirkl

    GeorgePirkl MDL Novice

    Feb 4, 2018
    45
    15
    0
    Great
     
  8. Paul Ski

    Paul Ski MDL Novice

    May 3, 2018
    5
    1
    0
    Thanks I've pretty much eliminated all bloatware from windows10 now by installing Windows10 Enterprise LTSB, its brilliant and has no bloat whatsoever.
     
  9. JLT2000

    JLT2000 MDL Junior Member

    Nov 3, 2020
    68
    20
    0
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Pl always use updates before tweaking offline image.
    Pl always use base UUP dump iso image.
    Pl use abbodi1406 W10 Updates Installer Script Tool for integeration of updates to your base iso image. After fully updated iso is created using abbodi1406 script tool then use that updated iso to tweak with any offline tweaking tool in this online world.

    thats all i wat to say to all who want a neat clean debloated iso as a result.
     
  11. shhnedo

    shhnedo MDL Expert

    Mar 20, 2011
    1,827
    2,429
    60
    You're using a very outdated servicing stack. Check the updates overview post for 1904x:
    https://forums.mydigitallife.net/threads/80763/
     
  12. shhnedo

    shhnedo MDL Expert

    Mar 20, 2011
    1,827
    2,429
    60
    W10UI.
    It's linked in that same updates overview post I mentioned.
     
  13. JLT2000

    JLT2000 MDL Junior Member

    Nov 3, 2020
    68
    20
    0
    #22177 JLT2000, Feb 27, 2022
    Last edited: Feb 27, 2022
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. maviejder

    maviejder MDL Novice

    Nov 22, 2018
    8
    2
    0
  15. shhnedo

    shhnedo MDL Expert

    Mar 20, 2011
    1,827
    2,429
    60
    It probably WILL, actually. W10UI is now defaulting to NOT update the iso boot files, which was causing this exact issue in UEFI mode.
     
  16. GeorgePirkl

    GeorgePirkl MDL Novice

    Feb 4, 2018
    45
    15
    0
    Have someone link on mydigitallife for ltsc2021 with latest working update for msmg ? THX