@echo off TITLE CopyWimFiles set aa=0 if /i %SystemDrive% == x: set aa=1 ver|find "5.">nul && set aa=1 if "%aa%" == "1" (cls&echo 不能在PE、XP中运行 &echo.&pause&exit) :: for /f "delims=" %%i in ('dir/b *.wim')do echo %%~ni>"%temp%\wim" for /f "delims=" %%i in ('dir/b *.sdi')do echo %%~ni>"%temp%\sdi" set/p wim=<"%temp%\wim" set/p sdi=<"%temp%\sdi" :: if exist "%wim%.txt" (set /p title=<"%wim%.txt" ) if exist "%wim%.txt" (echo %title% >"%temp%\title" ) del %wim%.txt >nul 2>nul :: md "%SystemDrive%\boot" >nul 2>nul md "%SystemDrive%\boot\%wim%" >nul 2>nul del "%SystemDrive%\boot\%wim%\*.wim" >nul 2>nul del "%SystemDrive%\boot\%wim%\*.sdi" >nul 2>nul :: copy "%wim%.wim" "%SystemDrive%\boot\%wim%" del "%wim%.wim" copy "%sdi%.sdi" "%SystemDrive%\boot\%wim%" del "%sdi%.sdi" if exist %windir%\SysWOW64 (start addwim.exe)else (start addwim.cmd) if exist %windir%\SysWOW64 (del addwim.cmd)else (del addwim.exe) echo.&echo.&echo 即将关闭窗口&timeout /t 15 del addwim.exe >nul 2>nul del addwim.cmd >nul 2>nul del %0 |
@echo off TITLE 添加BCD启动项 set aa=0 if /i %SystemDrive% == x: set aa=1 ver|find "5.">nul && set aa=1 if "%aa%" == "1" (cls&echo 不能在PE、XP中运行 &echo.&pause&exit) :: setlocal ENABLEDELAYEDEXPANSION set /a n=0 set /a current_n=-1 set /a bootmgr_n=-1 for %%h in ({bootmgr},{current}) do (set /a n+=1 &for /f "tokens=1* delims= " %%a in ('bcdedit /enum %%h') do (set "!n!_%%a=%%b")) set "boot_mode=-1" IF defined 2_path ( for %%q in (!2_path!) do (if /i "%%~xq"==".efi" set "boot_mode=UEFI")) if !boot_mode! equ -1 (IF defined 1_path ( set "boot_mode=UEFI")) :: set/p wim=<"%temp%\wim" del "%temp%\wim" set/p sdi=<"%temp%\sdi" del "%temp%\sdi" :: set title=%wim% if exist "%temp%\title" (set/p title=<"%temp%\title" ) del "%temp%\title" >nul 2>nul :: if exist "%SystemDrive%\boot\%wim%\id_1" (set/p id_1=<"%SystemDrive%\boot\%wim%\id_1" ) if exist "%SystemDrive%\boot\%wim%\id_2" (set/p id_2=<"%SystemDrive%\boot\%wim%\id_2" ) bcdedit /delete %id_1% /f >nul 2>nul bcdedit /delete %id_2% /f >nul 2>nul :: set id1={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffa} set id2={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffb} bcdedit /create %id2% /d "%title%" /device bcdedit /set %id2% ramdisksdidevice partition=%SystemDrive% bcdedit /set %id2% ramdisksdipath "\boot\%wim%\%sdi%.sdi" :: bcdedit /create %id1% /d "%title%" /application osloader bcdedit /set %id1% device ramdisk="[%SystemDrive%]\boot\%wim%\%wim%.wim",%id2% bcdedit /set %id1% osdevice ramdisk="[%SystemDrive%]\boot\%wim%\%wim%.wim",%id2% bcdedit /set %id1% path \windows\system32\boot\winload.exe if "%boot_mode%" == "UEFI" (bcdedit /set %id1% path \Windows\system32\boot\winload.efi) bcdedit /set %id1% description "%title%" bcdedit /set %id1% locale zh-CN bcdedit /set %id1% inherit {bootloadersettings} bcdedit /set %id1% systemroot \windows bcdedit /set %id1% detecthal Yes bcdedit /set %id1% winpe Yes bcdedit /set %id1% ems no bcdedit /displayorder %id1% /addlast echo %id1%>"%SystemDrive%\boot\%wim%\id_1" echo %id2%>"%SystemDrive%\boot\%wim%\id_2" :: echo @echo off >"%SystemDrive%\boot\DEL_%wim%.cmd" echo bcdedit /delete %id1% >>"%SystemDrive%\boot\DEL_%wim%.cmd" echo bcdedit /delete %id2% >>"%SystemDrive%\boot\DEL_%wim%.cmd" echo rd /s /q "%SystemDrive%\boot\%wim%" >>"%SystemDrive%\boot\DEL_%wim%.cmd" echo del "%SystemDrive%\boot\DEL_%wim%.cmd" >>"%SystemDrive%\boot\DEL_%wim%.cmd" :: echo.&echo.&echo 即将关闭窗口&timeout /t 10 &del %0 &exit |
rockup 发表于 2019-9-16 18:19
小白请问一下楼主,boot.sdi文件是那里来的呢?
我找了一个PE,替换testpe.wim,但最张用不了。可能问题出 ...
dxvyi 发表于 2019-9-17 19:58
太好了,一直在找这样的批处理程序
想问一下,addwim.exe比addwim.cmd多了什么设置?解包看两个批处理是一 ...
liu_zhenfeng 发表于 2019-9-18 11:14
addwim.exe里的addwim.cmd与外面的addwim.cmd什么区别也没有,重点是压成自解压时选64位模块。我一 ...
QQ拼音截图20200310134311.png (39.08 KB, 下载次数: 147)
liuzhaoyzz 发表于 2020-3-10 13:48
下载试了下楼主的批处理,运行了下,结果直接修改的是C:\boot\BCD,而且指向的也是C盘的C:\boot\TestPE\Tes ...
liuzhaoyzz 发表于 2020-3-10 13:48
下载试了下楼主的批处理,运行了下,结果直接修改的是C:\boot\BCD,而且指向的也是C盘的C:\boot\TestPE\Tes ...
zhang9876 发表于 2020-4-5 20:58
我替换了提示更改了硬件,启动不了,唉。。。
liu_zhenfeng 发表于 2020-4-5 21:50
是什么PE?我试下?
捕获.JPG (66.54 KB, 下载次数: 175)
zhang9876 发表于 2020-4-6 19:44
https://yunpan.360.cn/surl_yxn22vEP2Yh 有时间帮忙试试看,非常感谢
1.jpg (22.62 KB, 下载次数: 151)
2.jpg (67.87 KB, 下载次数: 150)
liuzhaoyzz 发表于 2020-3-10 13:48
下载试了下楼主的批处理,运行了下,结果直接修改的是C:\boot\BCD,而且指向的也是C盘的C:\boot\TestPE\Tes ...
liu_zhenfeng 发表于 2020-4-14 19:28
用choice试了一下,应该可以实现等待几秒默认选%SystemDrive%和手动输入驱动器字母。我还没有完整的思路. ...
qingyi78 发表于 2020-3-10 22:59
我自己不会写批处理,但是批处理高手可以在这几个命令之前加一段选择的命令,以替换%SystemDrive%
md ...
liu_zhenfeng 发表于 2020-4-15 16:38
@echo off
:begin
choice /t 10 /c:yn /d:y /m:"是否安装到%SystemDrive:~0,1%盘?"
zhang9876 发表于 2020-4-7 17:20
我重新测试了一下,还是EFI下提示就是这个,手动用easy bcd添加的是正常的。
双响炮 发表于 2020-9-5 11:02
你这个问题我也偶尔会遇到,真找不到原因,你后来是怎么解决的?
.__. 发表于 2021-3-6 22:29
楼主你好,我试了2个PE,都不行,全部提示 “最近更改了硬件或软件” 错误代码0xc000000e
另外想设置PE为 ...
liu_zhenfeng 发表于 2021-3-7 01:34
PE地址是?我测试一下
.__. 发表于 2021-3-7 01:51
一个是微PE,稍等我上传下
.__. 发表于 2021-3-7 02:01
您QQ是多少,我加下吧
链接:https://pan.baidu.com/s/1rA2JbUVqxbbNALsnxcXcvA
提取码:1111
1,自动设置PE为默认启动
2,在PE下删除PE启动项的脚本
liu_zhenfeng 发表于 2021-3-7 02:49
没有考虑过这个功能,建议手动:
.__. 发表于 2021-3-6 22:29
楼主你好,我试了2个PE,都不行,全部提示 “最近更改了硬件或软件” 错误代码0xc000000e
另外想设置PE为 ...
liu_zhenfeng 发表于 2021-3-7 02:38
在我的电脑上可以启动
liu_zhenfeng 发表于 2021-3-7 02:58
如果启动有问题建议用BOOTICE手动调到能启动的状态,再修改批处理bcdedit部分的命令
.__. 发表于 2021-3-6 22:12
你好,现在你解决了吗? 我也提示“最近更改了硬件或软件”
但是错误代码和你不一样,我是0xc000000e
wsdyleon 发表于 2021-3-17 10:07
前来学习一下,用不用下载sdi什么文件
liu_zhenfeng 发表于 2021-3-17 14:43
需要iso格式win10pe里面的wim 、sdi 文件。
搜狗截图20210317145919.png (26.86 KB, 下载次数: 215)
piaomusic 发表于 2022-3-26 17:48
安装后自动重启并进一次PE系统,哪位高手知道怎么修改吗?????
无标题.png (29.63 KB, 下载次数: 95)
欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) | Powered by Discuz! X3.3 |