In other words write is for writing
![:dubbio:](http://reboot.pro/public/style_emoticons/default/dubbio.gif)
dd is for copying little or large chunks of whatever from source file to destination file.
![:hi:](http://reboot.pro/public/style_emoticons/default/hi.gif)
Wonko
Posted 23 October 2010 - 08:57 PM
Posted 24 October 2010 - 03:16 PM
Posted 25 October 2010 - 06:04 AM
here is an example of how to alter 3 bytes of a boot file loaded into memory
title Install Windows 7 32-bit (bc2)
map --mem /BOOTMGR (rd)
write --offset=0x105E (rd)+1 \xEB\x08
write --offset=0x54696 (rd)+1 2
chainloader (rd)+1
root ()
So a few kb might take you quite a while to type in and the file size of menu.lst will probably be far too large!
cmd fc /b D:\boot\WIMS\BOOTind1.WIM D:\boot\WIMS\BOOTind2.WIM
00000060: 56 28 00000061: C4 6A 00000062: 0A 09 00000068: DB E8 00000069: 25 21 0000006A: CD A1 0000006B: 0F 10 00000070: 30 A0 00000071: 7F BA 00000072: 30 2B 00000078: 01 02
Posted 25 October 2010 - 07:35 PM
title Install Windows 7 32-bit (bc2) <- this is the title of the menu.kst entry
map --mem /BOOTMGR (rd) <- this maps the FILE "BOOTMGR" in ROOT of current device to (rd) RAMDISK.
write --offset=0x105E (rd)+1 \xEB\x08 <- this writes hex values EB 08 at offset (hex) 105E
write --offset=0x54696 (rd)+1 2<- this writes decimal value 2 at offset (hex) 54696
chainloader (rd)+1 <- this chainloads the (modified) ramdisk (i.e. the modified BOOTMGR FILE)
root () <-this establishes ROOT on current device (probably not strictly needed)
so the line in red above becomes:00000060: 56 28
00000061: C4 6A
00000062: 0A 09
then you add here as many lines as many contiguous set of bytes you have to change.write --offset=0x60 (rd)+1 \x28\x6A\x09
Posted 25 October 2010 - 08:18 PM
will damage BOOTMGR, and will lead to impossibility of loading.write - offset=0x60 (rd) +1 \x28\x6A\x09
Edited by kpdozer, 25 October 2010 - 08:26 PM.
Posted 03 November 2010 - 04:12 PM
Another idea, not tested:Has decided to create a boot drive with several LiveCD based on Winpe3.0.
I can boot with different boot.wim through grub4dos (boot1.wim, boot2.wim...) without problems.
To spare a place on CD (DVD) I would like to boot since various images in one WIM.
Differences seems to be at file header. Assumption: inside first 2048 bytes.For experiment I have merged 2 boot.wim in one.
I have received boot.wim with two images in
At first I have marked the first image as boot (boot index:1) then the second image as boot (boot index:2) and have compared results on bytes.
Posted 05 November 2010 - 06:59 PM
joakim did it againTo spare a place on CD (DVD) I would like to boot since various images in one WIM.
Posted 09 November 2010 - 06:11 PM
Posted 12 November 2010 - 08:20 PM
Posted 25 November 2010 - 06:54 PM
@echo off setlocal ENABLEDELAYEDEXPANSION set btdvc=%~d0 echo @echo off>%btdvc%\run.cmd echo title Setup>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo set edtn=none>>%btdvc%\run.cmd echo set answ=none>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo goto :imgslct>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :rstrtwzrd>>%btdvc%\run.cmd echo cls>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [%btdvc%] [ RESTART WIZARD ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [1] Restart Wizard>>%btdvc%\run.cmd echo echo [2] Select Image>>%btdvc%\run.cmd echo echo [3] Select Answer file>>%btdvc%\run.cmd echo echo [4] Start Setup>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo Image: [ %%edtn%% ] Answer file: [ %%answ%% ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [I] Select Image [A] Select Answer file>>%btdvc%\run.cmd echo echo [S] Start Setup [R] Restart Wizard>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo set /P slct= Select: >>%btdvc%\run.cmd echo if "%%slct%%"=="1" goto :rstrt>>%btdvc%\run.cmd echo if "%%slct%%"=="2" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="3" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="4" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="I" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="A" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="S" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="R" goto :rstrtwzrd>>%btdvc%\run.cmd echo if "%%slct%%"=="i" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="a" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="s" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="r" goto :rstrtwzrd>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :rstrt>>%btdvc%\run.cmd echo start %btdvc%\USBMultiWIMSetup.cmd>>%btdvc%\run.cmd echo exit>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :imgslct>>%btdvc%\run.cmd echo cls>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [%btdvc%] [ IMAGES ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd set vr1=1 for /R %btdvc%\images\ %%I in (*.wim) do ( echo echo [!vr1!] %%~nI>>!btdvc!\run.cmd call:cntr ) echo echo.>>%btdvc%\run.cmd echo echo Image: [ %%edtn%% ] Answer file: [ %%answ%% ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [I] Select Image [A] Select Answer file>>%btdvc%\run.cmd echo echo [S] Start Setup [R] Restart Wizard>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo set /P slct= Select: >>%btdvc%\run.cmd set vr1=1 set vr2=slct for /R %btdvc%\images\ %%I in (*.wim) do ( echo if "%%slct%%"=="!vr1!" set edtn=%%~nI>>!btdvc!\run.cmd call:cntr ) echo if "%%edtn%%"=="none" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="I" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="A" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="S" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="R" goto :rstrtwzrd>>%btdvc%\run.cmd echo if "%%slct%%"=="i" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="a" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="s" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="r" goto :rstrtwzrd>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :answslct>>%btdvc%\run.cmd echo cls>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [%btdvc%] [ ANSWER FILES ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd set vr1=1 for /R %btdvc%\answers\ %%I in (*.xml) do ( echo echo [!vr1!] %%~nI>>!btdvc!\run.cmd call:cntr ) echo echo [0] none>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo Image: [ %%edtn%% ] Answer file: [ %%answ%% ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [I] Select Image [A] Select Answer file>>%btdvc%\run.cmd echo echo [S] Start Setup [R] Restart Wizard>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo set /P slct= Select: >>%btdvc%\run.cmd set vr1=1 set vr2=slct for /R %btdvc%\answers\ %%I in (*.xml) do ( echo if "%%slct%%"=="!vr1!" set answ=%%~nI>>!btdvc!\run.cmd call:cntr ) echo if "%%slct%%"=="0" set answ=none>>%btdvc%\run.cmd echo if "%%slct%%"=="I" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="A" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="S" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="R" goto :rstrtwzrd>>%btdvc%\run.cmd echo if "%%slct%%"=="i" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="a" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="s" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="r" goto :rstrtwzrd>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :strtstp>>%btdvc%\run.cmd echo cls>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [%btdvc%] [ START SETUP ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [1] Start Setup>>%btdvc%\run.cmd echo echo [2] Select Image>>%btdvc%\run.cmd echo echo [3] Select Answer file>>%btdvc%\run.cmd echo echo [4] Restart Wizard>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo Image: [ %%edtn%% ] Answer file: [ %%answ%% ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo [I] Select Image [A] Select Answer file>>%btdvc%\run.cmd echo echo [S] Start Setup [R] Restart Wizard>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo set /P slct= Select: >>%btdvc%\run.cmd echo if "%%slct%%"=="1" goto :rnstp>>%btdvc%\run.cmd echo if "%%slct%%"=="2" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="3" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="4" goto :rstrtwzrd>>%btdvc%\run.cmd echo if "%%slct%%"=="I" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="A" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="S" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="R" goto :rstrtwzrd>>%btdvc%\run.cmd echo if "%%slct%%"=="i" goto :imgslct>>%btdvc%\run.cmd echo if "%%slct%%"=="a" goto :answslct>>%btdvc%\run.cmd echo if "%%slct%%"=="s" goto :strtstp>>%btdvc%\run.cmd echo if "%%slct%%"=="r" goto :rstrtwzrd>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :rnstp>>%btdvc%\run.cmd echo cls>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo ---[ STARTING SETUP ]>>%btdvc%\run.cmd echo echo.>>%btdvc%\run.cmd echo echo Image: [ %%edtn%% ] Answer file: [ %%answ%% ]>>%btdvc%\run.cmd echo if not "%%answ%%"=="none" goto :unstp>>%btdvc%\run.cmd echo X:\setup.exe /installfrom:%btdvc%\images\%%edtn%%.wim>>%btdvc%\run.cmd echo exit>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo :unstp>>%btdvc%\run.cmd echo X:\setup.exe /installfrom:%btdvc%\images\%%edtn%%.wim /unattend:%btdvc%\answers\%%answ%%.xml>>%btdvc%\run.cmd echo exit>>%btdvc%\run.cmd echo.>>%btdvc%\run.cmd echo pause>>%btdvc%\run.cmd endlocal set btdvc=%~d0 start %btdvc%\run.cmd ::pause exit :cntr set /A vr1=%vr1%+1
Edited by far.in.out, 25 November 2010 - 06:56 PM.
Posted 25 November 2010 - 08:43 PM
It looks for a certain directory structure and creates lists and menus to select images and answer files found and launch setup with selected parameters. But I haven't been able to start the setup as it says the path is incorrect. If anyone is still interested in this take a look. I'm sure it's just some syntax issue.
If this works someday it will be a lot easier and transparent procedure. It would be a lot easier to add and change images/answer files.
Posted 25 November 2010 - 10:36 PM
Posted 25 November 2010 - 11:15 PM
@echo off title Setup set edtn=none set answ=none goto :imgslct :rstrtwzrd cls echo. echo [C:] [ RESTART WIZARD ] echo. echo [1] Restart Wizard echo [2] Select Image echo [3] Select Answer file echo [4] Start Setup echo. echo Image: [ %edtn% ] Answer file: [ %answ% ] echo. echo [I] Select Image [A] Select Answer file echo [S] Start Setup [R] Restart Wizard echo. set /P slct= Select: if "%slct%"=="1" goto :rstrt if "%slct%"=="2" goto :imgslct if "%slct%"=="3" goto :answslct if "%slct%"=="4" goto :strtstp if "%slct%"=="I" goto :imgslct if "%slct%"=="A" goto :answslct if "%slct%"=="S" goto :strtstp if "%slct%"=="R" goto :rstrtwzrd if "%slct%"=="i" goto :imgslct if "%slct%"=="a" goto :answslct if "%slct%"=="s" goto :strtstp if "%slct%"=="r" goto :rstrtwzrd :rstrt start C:\USBMultiWIMSetup.cmd exit :imgslct cls echo. echo [C:] [ IMAGES ] echo. echo [1] install echo. echo Image: [ %edtn% ] Answer file: [ %answ% ] echo. echo [I] Select Image [A] Select Answer file echo [S] Start Setup [R] Restart Wizard echo. set /P slct= Select: if "%slct%"=="1" set edtn=install if "%edtn%"=="none" goto :imgslct if "%slct%"=="I" goto :imgslct if "%slct%"=="A" goto :answslct if "%slct%"=="S" goto :strtstp if "%slct%"=="R" goto :rstrtwzrd if "%slct%"=="i" goto :imgslct if "%slct%"=="a" goto :answslct if "%slct%"=="s" goto :strtstp if "%slct%"=="r" goto :rstrtwzrd :answslct cls echo. echo [C:] [ ANSWER FILES ] echo. echo [1] Autounattend echo [0] none echo. echo Image: [ %edtn% ] Answer file: [ %answ% ] echo. echo [I] Select Image [A] Select Answer file echo [S] Start Setup [R] Restart Wizard echo. set /P slct= Select: if "%slct%"=="1" set answ=Autounattend if "%slct%"=="0" set answ=none if "%slct%"=="I" goto :imgslct if "%slct%"=="A" goto :answslct if "%slct%"=="S" goto :strtstp if "%slct%"=="R" goto :rstrtwzrd if "%slct%"=="i" goto :imgslct if "%slct%"=="a" goto :answslct if "%slct%"=="s" goto :strtstp if "%slct%"=="r" goto :rstrtwzrd :strtstp cls echo. echo [C:] [ START SETUP ] echo. echo [1] Start Setup echo [2] Select Image echo [3] Select Answer file echo [4] Restart Wizard echo. echo Image: [ %edtn% ] Answer file: [ %answ% ] echo. echo [I] Select Image [A] Select Answer file echo [S] Start Setup [R] Restart Wizard echo. set /P slct= Select: if "%slct%"=="1" goto :rnstp if "%slct%"=="2" goto :imgslct if "%slct%"=="3" goto :answslct if "%slct%"=="4" goto :rstrtwzrd if "%slct%"=="I" goto :imgslct if "%slct%"=="A" goto :answslct if "%slct%"=="S" goto :strtstp if "%slct%"=="R" goto :rstrtwzrd if "%slct%"=="i" goto :imgslct if "%slct%"=="a" goto :answslct if "%slct%"=="s" goto :strtstp if "%slct%"=="r" goto :rstrtwzrd :rnstp cls echo. echo ---[ STARTING SETUP ] echo. echo Image: [ %edtn% ] Answer file: [ %answ% ] if not "%answ%"=="none" goto :unstp X:\setup.exe /installfrom:C:\images\%edtn%.wim exit :unstp X:\setup.exe /installfrom:C:\images\%edtn%.wim /unattend:C:\answers\%answ%.xml exit pause
Edited by far.in.out, 25 November 2010 - 11:38 PM.
Posted 25 November 2010 - 11:57 PM
Posted 26 November 2010 - 02:43 PM
@echo off title Scanning... for %%I in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%I:\4E32C7AE32DF2912 set destdrv=%%I: & goto :strt echo. echo FILES NOT FOUND, EXITING...) pause exit :strt start "Starting..." /wait "%destdrv%\USBMultiWIMSetup.cmd" exitI checked it many times - I echo'ed the final path generated - it's always correct. And I know what code you use... I started doing this after reading your guide. And I must say I didn't like it very much. Well actually it's fine except for using multiple bootmgr's, BCD's, boot.wim's and having to edit menu.lst.
Edited by far.in.out, 26 November 2010 - 02:47 PM.
Posted 26 November 2010 - 03:04 PM
Posted 26 November 2010 - 03:12 PM
What do you mean?The code had to be inserted into each boot.wim file, it will not work for multiple OS's if on the USB drive as a flat file.
Posted 27 November 2010 - 05:54 PM
Posted 27 November 2010 - 07:38 PM
Posted 30 December 2010 - 12:40 PM
Posted 30 December 2010 - 12:45 PM
Posted 30 December 2010 - 01:35 PM
What is the error? EXACT one, please.But when it comes to the Windows installation, I get an error because it doesn't find the install.wim, I guess it is trying to search for it in the first one.
0 members, 0 guests, 0 anonymous users