一个32G的U盘,用下面代码制作的win10在VMWARE上安装成功:
echo 开始往U盘复制文件,请耐心等候......
if not exist "%Drive2%:\" (color 0C &echo 目标U盘分区不存在。本批处理将退出。 &pause &goto :END)
type nul>"%temp%\xcopy_exclude_filelist.txt"
if exist "%Drive1%:\sources\install.wim" call :ISBIG4G "%Drive1%:\sources\install.wim"
xcopy "%Drive1%:\\" "%Drive2%:\\" /exclude:%temp%\xcopy_exclude_filelist.txt /e /h /r /k /j /q /y>nul ||(color 0C &echo 复制文件时出错!请查检原因。本批处理将退出。 &pause>nul &goto :END)
if /i "%instfileisbigger4g%"=="Y" (
echo install.wim大于4G,正在分割它,请耐心等待......
dism /Split-Image /ImageFile:%Drive1%:\sources\install.wim /SWMFile:%Drive2%:\sources\install.swm /FileSize:4000
)
color 0A
echo Windows 10 X64安装U盘制作完成!
echo -------------------------------------5--------------------------------------
echo.
goto :END
:ISBIG4G
set instfileisbigger4g=N
set instfilesize=%~z1
set instfilesize=%instfilesize:~0,-1%
if %instfilesize% gtr 429496729 (
echo %~1>>"%temp%\xcopy_exclude_filelist.txt"
set instfileisbigger4g=Y
) else (
echo ####################>>"%temp%\xcopy_exclude_filelist.txt"
set instfileisbigger4g=N
)
goto :EOF