Для таких целей (для подключения\тестирования) других РЕ использую отдельную папку _WIM Возможность загрузки различных РЕ как 7/8/8.1/10 так ХРЕ с предварительной правкой под свою папку, запускаешь батник и все автоматом правится. Допустим для РЕ 7/8/8.1/10 создается меню загрузки BCD:
Скрытый текст
@echo off if defined PROCESSOR_ARCHITEW6432 start %SystemRoot%\Sysnative\cmd.exe /c "%~f0" %* & exit cls >NUL 2>&1 fsutil dirty query %systemdrive% ||( echo.Run as Admin !!! >nul pause exit ) set "arch=x64" if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set "arch=x86" cd /d "%~dp0" set "imagex=Tools\%arch%\wimlib-imagex.exe" set "conx=Tools\conx.exe" If Not Exist ..\*.wim goto :eof %conx% color 0a echo. echo.Создание меню загрузки BCD echo. %conx% color 0f echo.%~dp0BCD If exist Tools\config\images.txt del /q /f Tools\config\images.txt 2>nul 1>&2 set bcdedit=Tools\bcdedit_%arch%.exe If Exist "%~dp0BCD" del /f /q "%~dp0BCD" for %%I in (..\*.wim) do call :creat %%I del /q /f /ah "%~dp0*.log" 2>nul 1>&2 del /q /f /ah "%~dp0BCD*.*" 2>nul 1>&2 Goto :eof :creat call :chek %1 set BCD=%bcdedit% /store "%~dp0BCD" If DEFINED 1 goto :eof If NoT Exist "%~dp0BCD" (%bcdedit% /createstore "%~dp0BCD" 2>nul 1>&2 for /f "tokens=2 delims={}" %%a in ('%BCD% /create {bootmgr} /d "Windows Boot Manager"') do ( %BCD% /set {%%a} inherit {globalsettings} 2>nul 1>&2 %BCD% /set {%%a} locale ru_RU 2>nul 1>&2 %BCD% /set {%%a} nointegritychecks yes 2>nul 1>&2 %BCD% /set {%%a} fontpath \_WIM\BOOT\FONTS 2>nul 1>&2 %BCD% /set {%%a} testsigning yes 2>nul 1>&2 %BCD% /set {%%a} Timeout 30 2>nul 1>&2 %BCD% /set {%%a} DisplayOrder {current} 2>nul 1>&2 %BCD% /set {%%a} DisplayBootMenu yes 2>nul 1>&2 ) If Exist "%~dp0memtest.exe" ( for /f "tokens=2 delims={}" %%i in ('%BCD% /create {memdiag} /d "Диагностика памяти"') do ( %BCD% /set {%%i} Device boot 2>nul 1>&2 %BCD% /set {%%i} Path \_WIM\BOOT\memtest.exe 2>nul 1>&2 %BCD% /set {%%i} inherit {globalsettings} 2>nul 1>&2 %BCD% /set {%%i} nointegritychecks YES 2>nul 1>&2 %BCD% /set {%%i} testsigning yes 2>nul 1>&2 %BCD% /set {%%i} locale ru_RU 2>nul 1>&2 %BCD% /ToolsDisplayOrder {memdiag} /addlast 2>nul 1>&2 ) ) for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "<<< Back to Grub4Dos-menu" /application bootsector') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device boot 2>nul 1>&2 %%~i path \_WIM\boot\GRLDR 2>nul 1>&2 %bcd% /displayorder {%%a} /addlast 2>nul 1>&2 ) If Exist "restart.bin" ( for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "<<< REBOOT <<<" /application bootsector') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device boot 2>nul 1>&2 %%~i path \_WIM\boot\restart.bin 2>nul 1>&2 %bcd% /displayorder {%%a} /addlast 2>nul 1>&2 ) ) If Exist "shutdown.bin" ( for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "<<< SCHUTDOWN <<<" /application bootsector') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device boot 2>nul 1>&2 %%~i path \_WIM\boot\shutdown.bin 2>nul 1>&2 %bcd% /displayorder {%%a} /addlast 2>nul 1>&2 ) ) If Exist "..\DPMS\C9DP.BIN" ( for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "Load driver from DPMS (Full DP XP/2003) & return Virtual FDD" /application bootsector') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device boot 2>nul 1>&2 %%~i path \_WIM\DPMS\C9DP.BIN 2>nul 1>&2 %bcd% /ToolsDisplayOrder {%%a} /addlast 2>nul 1>&2 ) ) If Exist "..\DPMS\Hiren.bin" ( for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "Dos Tools (Hiren)" /application bootsector') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device boot 2>nul 1>&2 %%~i path \_WIM\DPMS\Hiren.bin 2>nul 1>&2 %bcd% /ToolsDisplayOrder {%%a} /addlast 2>nul 1>&2 ) ) for /f "tokens=2 delims={}" %%a in ('%bcd% /create /d "Search & Start Windows 7/8/10" /application osloader') do ^ for %%i in ("%bcd% /set {%%a}") do ( %%~i device locate=custom:12000002 true 2>nul 1>&2 %%~i osdevice locate=custom:22000002 true 2>nul 1>&2 %%~i ResumeObject {%%a} 2>nul 1>&2 %%~i path "\Windows\system32\winload.exe" 2>nul 1>&2 %%~i systemroot "\Windows" 2>nul 1>&2 %%~i inherit {globalsettings} 2>nul 1>&2 %%~i nx OptIn 2>nul 1>&2 %bcd% /displayorder {%%a} /addfirst 2>nul 1>&2 %bcd% /default {%%a} 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%j in ('%BCD% /create {hypervisorsettings}') do ( %BCD% /set {%%j} Description "Hypervisor Settings" 2>nul 1>&2 %BCD% /set {%%j} hypervisordebugport "1" 2>nul 1>&2 %BCD% /set {%%j} hypervisorDEBUGTYPE "SERIAL" 2>nul 1>&2 %BCD% /set {%%j} hypervisorBAUDRATE "115200" 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%j in ('%BCD% /create {dbgsettings}') do ( %BCD% /set {%%j} DEBUGPORT "1" 2>nul 1>&2 %BCD% /set {%%j} DEBUGTYPE "SERIAL" 2>nul 1>&2 %BCD% /set {%%j} BAUDRATE "115200" 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%j in ('%BCD% /create {emssettings}') do ( %BCD% /set {%%j} bootems YES 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%j in ('%BCD% /create {ramdiskoptions}') do ( %BCD% /set {%%j} ramdisksdidevice Boot 2>nul 1>&2 %BCD% /set {%%j} ramdisksdipath \_WIM\BOOT\boot.sdi 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%k in ('%BCD% /create {bootloadersettings}') do ( %BCD% /set {%%k} fontpath \_WIM\BOOT\FONTS 2>nul 1>&2 %BCD% /set {%%k} INHERIT {globalsettings} {hypervisorsettings} 2>nul 1>&2 ) for /f "tokens=2 delims={}" %%k in ('%BCD% /create {globalsettings}') do ( %BCD% /set {%%k} fontpath \_WIM\BOOT\FONTS 2>nul 1>&2 %BCD% /set {%%k} nointegritychecks yes 2>nul 1>&2 %BCD% /set {%%k} testsigning yes 2>nul 1>&2 %BCD% /set {%%k} loadoptions DDISABLE_INTEGRITY_CHECKS 2>nul 1>&2 %BCD% /set {%%k} locale ru-RU 2>nul 1>&2 %BCD% /set {%%k} path "\Windows\system32\boot\winload.exe" 2>nul 1>&2 %BCD% /set {%%k} INHERIT {dbgsettings} {emssettings} 2>nul 1>&2 ) ) If Exist Tools\config\images.txt ( for /f "delims=" %%a in (Tools\config\images.txt) do If /i "%~nx1" == "%%a" exit /b ) for /f "tokens=2 delims={}" %%b in ('%BCD% /create /d ">>> %~n1" /application osloader') do ( %BCD% /set {%%b} osdevice ramdisk=[boot]%~pnx1,{ramdiskoptions} 2>nul 1>&2 %BCD% /set {%%b} inherit {globalsettings} 2>nul 1>&2 %BCD% /set {%%b} locale ru-RU 2>nul 1>&2 %BCD% /set {%%b} nointegritychecks yes 2>nul 1>&2 %BCD% /set {%%b} testsigning yes 2>nul 1>&2 %BCD% /set {%%b} bootmenupolicy legacy 2>nul 1>&2 %BCD% /set {%%b} loadoptions DDISABLE_INTEGRITY_CHECKS 2>nul 1>&2 %BCD% /set {%%b} detecthal yes 2>nul 1>&2 %BCD% /set {%%b} winpe yes 2>nul 1>&2 %BCD% /set {%%b} path "\Windows\system32\boot\winload.exe" 2>nul 1>&2 %BCD% /set {%%b} device ramdisk=[boot]%~pnx1,{ramdiskoptions} 2>nul 1>&2 %BCD% /set {%%b} systemroot "\Windows" 2>nul 1>&2 %BCD% /displayorder {%%b} /addlast 2>nul 1>&2 %BCD% /set {%%b} nx OptIn 2>nul 1>&2 ) exit /b :chek for /f "tokens=2* delims=:" %%a in ('%imagex% info %1 ^| find /i "System Root"') do ( If /i "%%a"==" I386" echo %~nx1>>Tools\config\images.txt ) exit /b
для ХРЕ немного сложнее, взял утилиты и сам батник RenameDir.cmd из проекта RusLive и поправил под свои нужды
[config] ;имя каталога - 4 символа [a-z]; если пусто, то по умолчанию использует BOOT (для XP/2003, 7, 8) oDir=_WIM ;iDir=XMPE ;iDir=BOOT iDir=RLNT Btmgr= PackOpt=--boot --compress=lzx:400 ;bcd - BCD-меню, 3 символа; если пусто, то по умолчанию использует BCD (для XP/2003, 7, 8) bcd=BCD ;winnt_sif_ne - файл ответов Native mode, 9 символов; если пусто, то по умолчанию использует NTNE (только для XP/2003) winnt_sif_ne= ;winnt_sif_pe - файл ответов Native mode, 9 символов; если пусто, то по умолчанию использует NTPE (только для XP/2003) winnt_sif_pe= bootpath=_WIM\BOOT native=RLNE.IM_ bootdi_wim=test.wim
\_WIM\BOOT\TOOLS\RenDirData\config.ini ну и потом читаются
Код:
for /f "delims=" %%a in ('%Autoit% Tools\iniread.au3 Tools\RenDirData\config.ini config idir xmpe') do set "iDir=%%a" for /f "delims=" %%a in ('%Autoit% Tools\iniread.au3 Tools\RenDirData\config.ini config odir _wim') do set "oDir=%%a"
также прописываем свое в файлах bootmgr.txt grubldr.txt images.txt menu.txt nativeXP.txt setupldr.txt txsif.txt делал для себя
Делал как-то батничек, для удаления не существующих пунктов в BCD меню. Полезно когда удаляешь не востребованые ядра из чей-либо сборки, также не нужные "костыли" - Что такое 'костыли' и зачем они нужны... для перехода в другое меню. Пример для 2K10:
Код:
rem Удаление не существующих пунктов меню @echo off cls cd /D "%~dp0" set "badpath=\Windows\system32\boot\winload.exe" @echo === BCD ====================================================================== If NOT Exist "%~dp0FONTS\BCD.main" copy /Y "%~dp0FONTS\BCD._\BCD.m_" "%~dp0FONTS\BCD.main" >nul set "bcdpath=%~dp0FONTS\BCD.main" CHCP 1251 >nul setlocal enabledelayedexpansion for /f "tokens=1,2" %%i in ('bcdedit.exe /store "%bcdpath%" /enum all ^|find /i "идентификатор"') do ( call :bs %%j for /f "tokens=2 delims=]," %%i in ('bcdedit.exe /store "%bcdpath%" /enum %%j ^|find /i "osdevice"') do ( set #path=%%i If NOT !#path!==%badpath% if not exist %~d0!#path! ( echo.*** %%j not exist !#path! bcdedit /store %bcdpath% /delete %%j /f /cleanup ) ) ) EndLocal del /q /f /ah "%~dp0FONTS\*.log" 2>nul 1>&2 del /q /f /ah "%~dp0FONTS\BCD.*.*" 2>nul 1>&2 pause goto :eof :bs for /f "tokens=2" %%i in ('bcdedit.exe /store "%bcdpath%" /enum %1 ^|find /i "path"') do ( set $path=%%i&If "!$path!"=="\Windows\system32\winload.exe" exit /b If NOT !$path!==%badpath% if not exist %~d0!$path! ( echo.*** %1 not exist !$path! bcdedit /store %bcdpath% /delete %1 /f /cleanup ) ) exit /b
В сборке присутствует файл menu_bcd_clear.cmd - дело в том, что я иногда переименовываю ядра, загрузчики и т.д Может пригодится кому
KisPavVlad, Допустим, не нужны вам ядра из сборки 2k10 или удаляете их и все соответствующее запускаете батник и также можно удалить загрузчики прежних версий, повторюсь
loban_ser писал(а):
75563В сборке присутствует файл menu_bcd_clear.cmd
В сборке 2k10 присутствует menu_bcd_clear.cmd, но он конкретно привязан к данной сбоке, правка батника минимальна, достаточно отредактировать путь к меню загрузки - FONTS\BCD.main под свой
Текущее время: 08-Апр 04:20
Часовой пояс: UTC + 3
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете голосовать в опросах Вы не можете прикреплять файлы к сообщениям Вы можете скачивать файлы