|
@echo off&&PUSHD %~dp0
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set "syspart=c"
format %syspart%: /Q
dism.exe /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:%syspart%:\ &&pause
:IsGPT
rem 判定是否是GPT磁盘。
echo list disk >yiwuyun.txt
for /f "skip=8 tokens=3 delims=B" %%k in ('diskpart /s yiwuyun.txt') do (
set temp=%%k
if "!temp:~8,1!"=="*" goto gpt
)
set gpt=false
echo Your disk is MBR disk!&&pause
ping 127.0.0.1 -n 5 >nul 2>nul
bcdboot %syspart%:\Windows /f bios /l zh-cn /s %syspart%:
bootsect /nt60 %syspart%:
goto nogpt
:gpt
set gpt=true
echo Your disk is GPT disk!&&pause
ping 127.0.0.1 -n 5 >nul 2>nul
bcdboot %syspart%:\Windows /l zh-cn
:nogpt
if exist yiwuyun.txt del yiwuyun.txt || exit /b 1
rem echo errorlevel is !errorlevel!
exit /b 0
也不知是那大侠的作品,简单实用,将镜像拖到此批理上即可。 |
|