Jump to content











Photo
- - - - -

booting vista/2008/w7 from usb sub folder


  • Please log in to reply
175 replies to this topic

#126 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 October 2010 - 08:57 PM

You can use dd (instead of write) and copy parts of files to a given address of another file.

In other words write is for writing :dubbio: (usually a few bytes).
dd is for copying little or large chunks of whatever from source file to destination file.

:hi:
Wonko

#127 kpdozer

kpdozer

    Newbie

  • Members
  • 11 posts

Posted 24 October 2010 - 03:16 PM

Thanks for answers.
For some reasons, I can use only CD (DVD) not Usb. Therefore it is impossible to produce copying operations.
File Boot.wim too big to load it in the RAM.
I have try to divide it on swm-files of the small size. Further I loaded in the RAM only the first of them, and changed it as it is necessary.
But the loader can't connect remaining swm files.

Therefore the best variant to load in RAM BOOTMGR and BOOT.SDI and to make write. But I don't know offsets and values which are responsible boot index. Whether these values to someone are known?

#128 kpdozer

kpdozer

    Newbie

  • Members
  • 11 posts

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!


I am sorry.
I have committed an error when wrote about kilobytes. Of course it is a question of bytes.
There are 2 files BOOTind1.WIM and BOOTind2.WIM (267 mb).
They differ only with value boot index inside.
Here result of a command:

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


#129 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 October 2010 - 07:35 PM

Let's see:
In the example given:

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)


From your FC you have a difference in three contiguous bytes styarting at offset hex 60:

00000060: 56 28
00000061: C4 6A
00000062: 0A 09

so the line in red above becomes:

write --offset=0x60 (rd)+1 \x28\x6A\x09

then you add here as many lines as many contiguous set of bytes you have to change.
etc.


:)
Wonko

#130 kpdozer

kpdozer

    Newbie

  • Members
  • 11 posts

Posted 25 October 2010 - 08:18 PM

Thanks for the detailed description of an example.
But I have applied FC to WIM-files in the size of 267 mbytes.
The received offsets and values from WIM-files can't be applied to file BOOTMGR, after its location in the RAM (map - mem /BOOTMGR (rd)).

Procedure

write - offset=0x60 (rd) +1 \x28\x6A\x09

will damage BOOTMGR, and will lead to impossibility of loading.

Offsets and values responsible "boot index" as remain unknown. :)
Probably it is better to consider a file boot.sdi which loads boot.wim in the RAM.

Edited by kpdozer, 25 October 2010 - 08:26 PM.


#131 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 03 November 2010 - 04:12 PM

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.

Another idea, not tested:
ISO9660 allows fragmented files. The feature is called Multi-Extent.
Compare 9.1.6 File Flags at ECMA 119. http://www.ecma-inte...ds/Ecma-119.htm
A file can be splittet to several file extents. And one file extent can be used by several files.
The file system driver has to read several file extents and concat them to one file.
Windows 95 and newer file system driver can read multi-extent files.
However: does bootmgr read multi-extent files too?

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.

Differences seems to be at file header. Assumption: inside first 2048 bytes.
Once CD (DVD) data sector holds 2048 bytes data.
Split boot.wim into two parts:
a different header file, each 2048 bytes: boot1.wim (boot index:1) and boot2.wim (boot index:2)
equal rest of file: use two equal file names boot1.win and boot2.win
equal file get different directory entries at ISO9660, but file itself is added once only.
Two 267 mb boot.wim require 267 mb space at CD (DVD) still.

Adjust bcd to launch boot1.wim or boot2.wim.

Use mkisofs and create a ISO image.
Read ISO9660 again, about 9660 times :hyper:
Run a hex editor, open ISO image.
Adjust Multi-Extent bit: change one bit at two locations.

Again, that's a idea.
Bootmgr may work or fail at Multi-Extent files.

Good luck.

#132 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 05 November 2010 - 06:59 PM

To spare a place on CD (DVD) I would like to boot since various images in one WIM.

joakim did it again
http://www.msfn.org/...702#entry944702

#133 kpdozer

kpdozer

    Newbie

  • Members
  • 11 posts

Posted 09 November 2010 - 06:11 PM

Outstanding work. At last. :confused1:

#134 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 November 2010 - 11:29 PM

Cool! It works! I have written it up here. Hope it makes sense! You guys rock!

#135 kpdozer

kpdozer

    Newbie

  • Members
  • 11 posts

Posted 12 November 2010 - 08:20 PM

There is one insignificant lack
Boot.wim boots in the RAM completely, including all images inside. It is necessary that boot.wim (with several images) was located in the RAM. To calculate the correct size difficult.

#136 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 25 November 2010 - 06:54 PM

I've been doing smth recently... Trying to make it somewhat easier...
Here's a script that I've made

@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 &#58;imgslct>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;rstrtwzrd>>%btdvc%\run.cmd

echo cls>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;%btdvc%&#93;  &#91; RESTART WIZARD &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;1&#93; Restart Wizard>>%btdvc%\run.cmd

echo echo &#91;2&#93; Select Image>>%btdvc%\run.cmd

echo echo &#91;3&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;4&#93; Start Setup>>%btdvc%\run.cmd



echo echo.>>%btdvc%\run.cmd

echo echo Image&#58; &#91; %%edtn%% &#93; Answer file&#58; &#91; %%answ%% &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo set /P slct= Select&#58; >>%btdvc%\run.cmd



echo if &#34;%%slct%%&#34;==&#34;1&#34; goto &#58;rstrt>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;2&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;3&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;4&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;I&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;A&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;S&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;R&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;i&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;a&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;s&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;r&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;rstrt>>%btdvc%\run.cmd

echo start %btdvc%\USBMultiWIMSetup.cmd>>%btdvc%\run.cmd

echo exit>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;imgslct>>%btdvc%\run.cmd

echo cls>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;%btdvc%&#93;  &#91; IMAGES &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd



set vr1=1



for /R %btdvc%\images\ %%I in &#40;*.wim&#41; do &#40;

	echo echo &#91;!vr1!&#93; %%~nI>>!btdvc!\run.cmd

	call&#58;cntr

	&#41;



echo echo.>>%btdvc%\run.cmd

echo echo Image&#58; &#91; %%edtn%% &#93; Answer file&#58; &#91; %%answ%% &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo set /P slct= Select&#58; >>%btdvc%\run.cmd



set vr1=1

set vr2=slct



for /R %btdvc%\images\ %%I in &#40;*.wim&#41; do &#40;

	echo if &#34;%%slct%%&#34;==&#34;!vr1!&#34; set edtn=%%~nI>>!btdvc!\run.cmd

	call&#58;cntr

	&#41;



echo if &#34;%%edtn%%&#34;==&#34;none&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;I&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;A&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;S&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;R&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;i&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;a&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;s&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;r&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;answslct>>%btdvc%\run.cmd

echo cls>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;%btdvc%&#93;  &#91; ANSWER FILES &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd



set vr1=1



for /R %btdvc%\answers\ %%I in &#40;*.xml&#41; do &#40;

	echo echo &#91;!vr1!&#93; %%~nI>>!btdvc!\run.cmd

	call&#58;cntr

	&#41;



echo echo &#91;0&#93; none>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo Image&#58; &#91; %%edtn%% &#93; Answer file&#58; &#91; %%answ%% &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo set /P slct= Select&#58; >>%btdvc%\run.cmd



set vr1=1

set vr2=slct



for /R %btdvc%\answers\ %%I in &#40;*.xml&#41; do &#40;

	echo if &#34;%%slct%%&#34;==&#34;!vr1!&#34; set answ=%%~nI>>!btdvc!\run.cmd

	call&#58;cntr

	&#41;



echo if &#34;%%slct%%&#34;==&#34;0&#34; set answ=none>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;I&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;A&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;S&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;R&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;i&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;a&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;s&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;r&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;strtstp>>%btdvc%\run.cmd

echo cls>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;%btdvc%&#93;  &#91; START SETUP &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;1&#93; Start Setup>>%btdvc%\run.cmd

echo echo &#91;2&#93; Select Image>>%btdvc%\run.cmd

echo echo &#91;3&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;4&#93; Restart Wizard>>%btdvc%\run.cmd



echo echo.>>%btdvc%\run.cmd

echo echo Image&#58; &#91; %%edtn%% &#93; Answer file&#58; &#91; %%answ%% &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file>>%btdvc%\run.cmd

echo echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo set /P slct= Select&#58; >>%btdvc%\run.cmd



echo if &#34;%%slct%%&#34;==&#34;1&#34; goto &#58;rnstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;2&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;3&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;4&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;I&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;A&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;S&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;R&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;i&#34; goto &#58;imgslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;a&#34; goto &#58;answslct>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;s&#34; goto &#58;strtstp>>%btdvc%\run.cmd

echo if &#34;%%slct%%&#34;==&#34;r&#34; goto &#58;rstrtwzrd>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;rnstp>>%btdvc%\run.cmd

echo cls>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo ---&#91; STARTING SETUP &#93;>>%btdvc%\run.cmd

echo echo.>>%btdvc%\run.cmd

echo echo Image&#58; &#91; %%edtn%% &#93; Answer file&#58; &#91; %%answ%% &#93;>>%btdvc%\run.cmd



echo if not &#34;%%answ%%&#34;==&#34;none&#34; goto &#58;unstp>>%btdvc%\run.cmd



echo X&#58;\setup.exe /installfrom&#58;%btdvc%\images\%%edtn%%.wim>>%btdvc%\run.cmd

echo exit>>%btdvc%\run.cmd

echo.>>%btdvc%\run.cmd



echo &#58;unstp>>%btdvc%\run.cmd

echo X&#58;\setup.exe /installfrom&#58;%btdvc%\images\%%edtn%%.wim  /unattend&#58;%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



&#58;&#58;pause

exit



&#58;cntr

set /A vr1=%vr1%+1

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.

Edited by far.in.out, 25 November 2010 - 06:56 PM.


#137 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

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.


It is of hard readability. :)

Maybe you could be interested in this:
Group commands for redirection:
http://www.robvander...levertricks.php

also, if you do:
SET dest=%~d0\run.cmd


You can use %dest%.

:D
Wonko

#138 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 November 2010 - 10:36 PM

Also save some lines by using /I to make IF statements case insensitive

IF /I "%ANSWER%"=="y" echo Answer was Y or y

#139 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 25 November 2010 - 11:15 PM

Tnx... But I was hoping you'd tell me how to properly start setup.exe with these parameters so I could use images with different names from one folder... That's the point of all my work here...

Also, if it's hard to read then save it and run and see the script it generates. That shouldn't be hard to read. But you'd also need two dirs (at the same place where you put this script, at the root of some drive) with .wim and .xml files inside of 'em for that, obviously.

This is the script it generates... Note that it's contents depends on what it had found in two dirs images and answers...

@echo off

title Setup



set edtn=none

set answ=none



goto &#58;imgslct



&#58;rstrtwzrd

cls

echo.

echo &#91;C&#58;&#93;  &#91; RESTART WIZARD &#93;

echo.

echo &#91;1&#93; Restart Wizard

echo &#91;2&#93; Select Image

echo &#91;3&#93; Select Answer file

echo &#91;4&#93; Start Setup

echo.

echo Image&#58; &#91; %edtn% &#93; Answer file&#58; &#91; %answ% &#93;

echo.

echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file

echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard

echo.

set /P slct= Select&#58; 

if &#34;%slct%&#34;==&#34;1&#34; goto &#58;rstrt

if &#34;%slct%&#34;==&#34;2&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;3&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;4&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;I&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;A&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;S&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;R&#34; goto &#58;rstrtwzrd

if &#34;%slct%&#34;==&#34;i&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;a&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;s&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;r&#34; goto &#58;rstrtwzrd



&#58;rstrt

start C&#58;\USBMultiWIMSetup.cmd

exit



&#58;imgslct

cls

echo.

echo &#91;C&#58;&#93;  &#91; IMAGES &#93;

echo.

echo &#91;1&#93; install

echo.

echo Image&#58; &#91; %edtn% &#93; Answer file&#58; &#91; %answ% &#93;

echo.

echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file

echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard

echo.

set /P slct= Select&#58; 

if &#34;%slct%&#34;==&#34;1&#34; set edtn=install

if &#34;%edtn%&#34;==&#34;none&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;I&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;A&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;S&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;R&#34; goto &#58;rstrtwzrd

if &#34;%slct%&#34;==&#34;i&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;a&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;s&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;r&#34; goto &#58;rstrtwzrd



&#58;answslct

cls

echo.

echo &#91;C&#58;&#93;  &#91; ANSWER FILES &#93;

echo.

echo &#91;1&#93; Autounattend

echo &#91;0&#93; none

echo.

echo Image&#58; &#91; %edtn% &#93; Answer file&#58; &#91; %answ% &#93;

echo.

echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file

echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard

echo.

set /P slct= Select&#58; 

if &#34;%slct%&#34;==&#34;1&#34; set answ=Autounattend

if &#34;%slct%&#34;==&#34;0&#34; set answ=none

if &#34;%slct%&#34;==&#34;I&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;A&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;S&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;R&#34; goto &#58;rstrtwzrd

if &#34;%slct%&#34;==&#34;i&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;a&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;s&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;r&#34; goto &#58;rstrtwzrd



&#58;strtstp

cls

echo.

echo &#91;C&#58;&#93;  &#91; START SETUP &#93;

echo.

echo &#91;1&#93; Start Setup

echo &#91;2&#93; Select Image

echo &#91;3&#93; Select Answer file

echo &#91;4&#93; Restart Wizard

echo.

echo Image&#58; &#91; %edtn% &#93; Answer file&#58; &#91; %answ% &#93;

echo.

echo &#91;I&#93; Select Image &#91;A&#93; Select Answer file

echo &#91;S&#93; Start Setup  &#91;R&#93; Restart Wizard

echo.

set /P slct= Select&#58; 

if &#34;%slct%&#34;==&#34;1&#34; goto &#58;rnstp

if &#34;%slct%&#34;==&#34;2&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;3&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;4&#34; goto &#58;rstrtwzrd

if &#34;%slct%&#34;==&#34;I&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;A&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;S&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;R&#34; goto &#58;rstrtwzrd

if &#34;%slct%&#34;==&#34;i&#34; goto &#58;imgslct

if &#34;%slct%&#34;==&#34;a&#34; goto &#58;answslct

if &#34;%slct%&#34;==&#34;s&#34; goto &#58;strtstp

if &#34;%slct%&#34;==&#34;r&#34; goto &#58;rstrtwzrd



&#58;rnstp

cls

echo.

echo ---&#91; STARTING SETUP &#93;

echo.

echo Image&#58; &#91; %edtn% &#93; Answer file&#58; &#91; %answ% &#93;

if not &#34;%answ%&#34;==&#34;none&#34; goto &#58;unstp

X&#58;\setup.exe /installfrom&#58;C&#58;\images\%edtn%.wim

exit



&#58;unstp

X&#58;\setup.exe /installfrom&#58;C&#58;\images\%edtn%.wim  /unattend&#58;C&#58;\answers\%answ%.xml

exit



pause

Edited by far.in.out, 25 November 2010 - 11:38 PM.


#140 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 November 2010 - 11:57 PM

The command line looks OK, but is the drive letter correct?

I use


SET DD=W732
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:\%DD%\install.wim set DVDdrive=%%I:
If NOT "%DVDDrive%"=="" echo Found Install.wim at %DVDdrive%\%DD%\install.wim
IF "%DVDdrive%"=="" (
echo ERROR - COULD NOT FIND INSTALL.WIM in %DD% folder!
pause
pause
goto :EOF
)



to get the drive letter where the wim file (W732.wim) is located.

and then use this code to start from the correct location...



if exist %DVDdrive%\%DD%\unattend.xml SET UN=/unattend:%DVDdrive%\%DD%\unattend.xml
if exist %DVDdrive%\%DD%\OEM\nul SET OEM=/m:%DVDdrive%\%DD%\OEM

REM look for whole sources folder copied over
If exist %DVDdrive%\%DD%\setup.exe (
%DVDdrive%
REM setup will use its path to find the install.wim
%DVDdrive%\%DD%\setup.exe %OEM% %UN%

goto :RBT
)

if not exist X:\Setup.exe goto :BAD
REM if not then just call setup in root of boot.wim
X:\setup.exe /installfrom:%DVDdrive%\%DD%\install.wim %OEM% %UN%
goto :RBT


:BAD
dir X:\ /b
echo Cannot find X:\Setup.exe !
@echo Press a key to reboot now...
pause

:RBT
wpeutil reboot
pause


see http://sites.google....and-server-2008 for more details.

#141 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 26 November 2010 - 02:43 PM

The letter is correct. Here is the code that starts my script:
@echo off

title Scanning...

for %%I in &#40;C D E F G H I J K L M N O P Q R S T U V W X Y Z&#41; do if exist %%I&#58;\4E32C7AE32DF2912 set destdrv=%%I&#58; & goto &#58;strt

echo.

echo	FILES NOT FOUND, EXITING...&#41;

pause

exit



&#58;strt

start &#34;Starting...&#34; /wait &#34;%destdrv%\USBMultiWIMSetup.cmd&#34;

exit
I 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.
I saw you were loading images from different folders than sources and then I found that parameter in the code. I decided to make an improved version which wouldn't require anything but the disk structure and you could make changes just by placing a different image(s) or answer file(s) in corresponding folders. But it just didn't work out. No idea why. It's very simple and obvious. Everything works but setup.exe just doesn't take it. I guess it's just another MS fck up and you can't do anything about it.
I guess I'll just switch to using flash drive with multiple partitions and a bootmgr in every of am. That way I'll be able to choose with grub a partition and boot off of it by bootmgr and boot the standard boot.wim. Every partition will have one (easy replacable) install.wim with two same images in it - x64 and x86 versions. Also there will be an answer file on each partition that will fit to both images in the wim.

Edited by far.in.out, 26 November 2010 - 02:47 PM.


#142 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 November 2010 - 03:04 PM

now you know why I had to do it as I described! Yes it is horrible and awkward, but I could not find a neater way :)

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.

#143 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 26 November 2010 - 03:12 PM

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.

What do you mean?

#144 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 November 2010 - 03:15 PM

see step 6 at http://sites.google....and-server-2008

#145 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 27 November 2010 - 05:54 PM

I made it work!!! :) Turns out you have to use x:\sources\setup.exe and not x:\setup.exe... Dam'n U MS!!! :) Just installed from \images dir and everything's OK! Also made some improvements to scripts, some were suggested by you, thanks... What do you think I should do now? Should I start a dedicated thread?

#146 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 27 November 2010 - 07:38 PM

yes - start a new thread and give a clear tutorial

Aim - what are you trying to do and what do you end up with

step by step instructions

any files, etc. needed

So you have tested using two different DVDs sources from same USB drive?

cheers

S

#147 far.in.out

far.in.out

    Member

  • Expert
  • 53 posts
  •  
    Ukraine

Posted 29 November 2010 - 12:27 AM

Here's the thread.

#148 requiem

requiem
  • Members
  • 7 posts
  •  
    Spain

Posted 30 December 2010 - 12:40 PM

Hello,

I was wondering if it is possible to have several partitions in the usb, and put all the files in one partition that is not the first one.
I've managed to be able to boot a linux distribution booting everything from the second partition and leaving the first one blank.
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.

I am trying to do this, because since normal windows systems by default only reads the first partition of the usb, I can have all the files hidden, and keep the remain space of the usb as a normal usb.

By the way, thanks you all, you did a magnificence effort :(

#149 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 30 December 2010 - 12:45 PM

When the system boots it will be running WinPE and WinPE will try to mount all volumes that it can see. Is the 2nd partition visible by Windows when booted to WinPE? What type is it and what format? If you hit SHIFT+F10 you might get a shell window and you can run DISKPART to see what drives are mounted?

#150 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 30 December 2010 - 01:35 PM

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.

What is the error? EXACT one, please.

I presume that it is not the BOOTMGR/BCD not finding the boot.wim, but rather the boot.wim (actually files inside it) incapable of "finding itself".

You may need to add a filter driver to the PE/install build.

Try as an experiment this approach:
http://www.msfn.org/...omusb-with-gui/
it should allow installing Vista/7 (which actually is a PE 2.x/3.x) booting off any partition on a USB drive, even if "Removable" as your USB stick is.

:(
Wonko




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users