1.jpg (103.92 KB, 下载次数: 304)
江南一根葱 发表于 2018-4-5 12:56
可以,我写了个查找当前目录下的wim文件添加到启动菜单,win7下添加测试成功,10貌似没成功,所以搁置着
807979023 发表于 2018-4-5 13:21
能不能分享一下,感觉很适用,只要是指定名称的wim都行,我只会添加xp和grldr。
807979023 发表于 2018-4-5 13:21
能不能分享一下,感觉很适用,只要是指定名称的wim都行,我只会添加xp和grldr。
y7y007 发表于 2018-4-5 19:23
论坛以前qiqiqicool大神的 WimRamOS_制作与热备份工具 批处理里面有这个的
江南一根葱 发表于 2018-4-5 20:27
我弄得有点复杂,可以编辑下用,把批处理wim文件和boot.sdi放在同个目录下,不管wim文件名
@echo of ...
807979023 发表于 2018-4-6 16:22
谢谢分享!批处理和boot.wim和BOOT.SDI 在任意目录中运行,添加错误,运行后兰屏
批处理 ...
807979023 发表于 2018-4-6 17:54
终于按自已的要求修改成功,感谢楼上两位提供的代码。
添加wim菜单项.bat :
inxiaoxi 发表于 2019-3-6 11:33
感谢感谢!成功了
2.jpg (56.21 KB, 下载次数: 282)
@echo off set aa=0 if /i %SystemDrive% == x: set aa=1 ver|find "5.">nul && set aa=1 if "%aa%" == "1" ( cls&echo 不能在PE、XP中运行 ping 127.1 -n 5 >nul 2>nul&&exit ||pause&exit ) :: if exist %SystemDrive%\boot\Win7PE\id_1 (set/p id_1=<%SystemDrive%\boot\Win7PE\id_1 ) if exist %SystemDrive%\boot\Win7PE\id_2 (set/p id_2=<%SystemDrive%\boot\Win7PE\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 "Win7_PE" /device bcdedit /set %id2% ramdisksdidevice partition=%SystemDrive% bcdedit /set %id2% ramdisksdipath \boot\Win7PE\Win7_PE.sdi :: bcdedit /create %id1% /d "Win7_PE" /application osloader bcdedit /set %id1% device ramdisk=[%SystemDrive%]\boot\Win7PE\Win7_PE.wim,%id2% bcdedit /set %id1% osdevice ramdisk=[%SystemDrive%]\boot\Win7PE\Win7_PE.wim,%id2% bcdedit /set %id1% path \windows\system32\boot\winload.exe bcdedit /set %id1% description Win7_PE 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\Win7PE\id_1 echo %id2%>%SystemDrive%\boot\Win7PE\id_2 :: ping 127.1 -n 10 >nul 2>nul&&exit ||pause&exit |
@echo off md %SystemDrive%\boot\Win7PE copy Win7_PE.wim %SystemDrive%\boot\Win7PE copy Win7_PE.sdi %SystemDrive%\boot\Win7PE if exist %windir%\SysWOW64 (start addwim.exe)else (start addwim.cmd) |
@echo off 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" :: md "%SystemDrive%\boot\%wim%" 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 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) :: set/p wim=<"%temp%\wim" del "%temp%\wim" set/p sdi=<"%temp%\sdi" del "%temp%\sdi" :: 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 "%wim%" /device bcdedit /set %id2% ramdisksdidevice partition=%SystemDrive% bcdedit /set %id2% ramdisksdipath "\boot\%wim%\%sdi%.sdi" :: bcdedit /create %id1% /d "%wim%" /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 bcdedit /set %id1% description "%wim%" 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 |
3.jpg (89.2 KB, 下载次数: 243)
807979023 发表于 2020-5-19 17:07
小改一下,BOOT.WIM和BOOT.SDI 可以放入任意分区 任意文件夹。
id值{20200519-1646-5277-eeee-fffffffffff ...
y7y007 发表于 2018-4-5 19:23
论坛以前qiqiqicool大神的 WimRamOS_制作与热备份工具 批处理里面有这个的
liuzhaoyzz 发表于 2020-5-20 07:25
你确定boot.sdi放在任意分区,真的在所有条件下都能启动?
807979023 发表于 2020-5-20 10:04
简单条件下测试通过,复杂条件下未测试,不知道,可能不行。
另外,grldr也可以放在任意分区任意文件夹 ...
liuzhaoyzz 发表于 2020-5-20 12:07
GPT分区,引导用的BCD如果在ESP分区,一般要求boot.sdi也在ESP分区,一般不可能放到“任意分区 ...
Bluebells 发表于 2020-5-20 19:54
UEFI 引导 + GPT 分区样式,标准的 Windows 引导,其 BCD 都是在 ESP 分区吧,但 BOOT.SDI 不在 ESP 分区 ...
gmy 发表于 2021-9-21 10:30
加精,欢迎更多人讨论。
nttwqz 发表于 2021-9-21 13:14
版主是不是喝了十斤二锅头?
像GRUB4DOS for UEFI这样需要编程实现的帖子都不是精华,本帖何以配的上 ...
610644034 发表于 2021-10-16 22:42
一直用自己的脚本,自己想怎样都行!
@echo off
setlocal enabledelayedexpansion
zhang9876 发表于 2020-4-5 20:39
传统模式用这个,右击用管理员身份运行。
欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) | Powered by Discuz! X3.3 |