Jump to content











Photo
* * * * * 1 votes

Ultimate-Super-Smart-Secret 'Removable' USB Drive with Mega-Booting

multi boot dual partition grub4dos easy2boot removable usb drive iso image uefi uefi multi.exe usb booting winntsetup 3

  • Please log in to reply
77 replies to this topic

#26 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 01 August 2014 - 05:07 AM

@cdob
 
Thanks for testing.......
 

 By Murphy 79, on 3 Aug 2014,-  11:47 PM, said in PM

 

setup.exe is what is ran after the system finally boots. If you didn't have that, it wouldn't do anything after booting.
It would just reboot.

boot.wim are different that install.wim in that they have a single bootable index.
In the typical boot.wim it has the first index "Windows PE" which is used during upgrades and is not bootable.
This information gets copied to the $~BTWINDOWS folder during setup and the system proceeds from there.

The 2nd index in the boot.wim is bootable and contains most of the same files as the first index except that it is designed for boot installs.
The exact difference, I do not know. I know that they are very similar, but one is bootable.

As far as the setup.exe's functionality... I know that you need the same file that is in your boot.wim's bootable index root (setup.exe) in the dvd's sources\ folder.
If they mismatch because of updates or something, it will give you a driver error during install. Well technically it has to be in the same folder as whatever boot.wim file you booted to.
So if you use 2 different folders, the corresponding boot.wim's setup.exe would need to be in the said folder.

I "think" they are the same for x86 and x64, but I could be mistaken. I would do your own research if you plan on copy/pasting them around.
 
--------------
 
Think of boot.wim as the setup program and install.wim as the payload.
boot.wim only contains the files to run the setup program.
install.wim contains what it tries to install.

The setup.exe inside the boot.wim will detect the architecture of the index you are trying to install.
There's a flag for each index to list whether or not it's x86 or amd64. The overall wim file is not specific to x86 or x64, but each index is.
 
--------------
 
install.wim does not have an architecture. If you have x86 indexes it will try to use those on an x86 setup.
If you have x64 indexes, it will try to use those by default.
 
--------------
 

 

You cannot boot both x86 and x64 UEFI from the same iso.
It needs the bootmgr.efi from the x86 version for x86 booting and the x64 version for x64 booting.

 
--------------
 

I don't believe that the boot sector affects uefi booting. I think it's determined by the bootia32.efi, bootx64.efi and bootmgr.efi files. I really don't think you can dual-uefi-boot the x86 and x64 without modding the efi files to point to different bootmgr.efi files.

 

 

Actually after reading murphy msgs , I was thinking about merging indexes of x86 and x64 into 'x86_boot.wim'.

But now I decide to use both 'x86_boot.wim' and 'x64_boot.wim' in place of using only 'x86_boot.wim' because modification is looking very complex..

 

I want x86 UEFI booting because of increasing WIN Tablet around. 

 

Are you totally sure that 'bootmgr.efi' is not used at USB disk.

 

Is it necessary to use 64-bit 'install.wim' in order to install 'Win 8.1 U1' into 64-bit UEFI firmwar/system ?

                                                       OR

Can I also use 32-bit 'install.wim' in place of 64-bit 'install.wim' ?

 

Regards...



#27 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 04 August 2014 - 06:00 AM

Guys,
I've just found a new free app-launcher called TBlauncher (created by Terabyte Unlimited). There are 32bit and 64it versions.
Looks like a good alternative for Pstart.

Download the following zip and inside you can find both:
http://www.terabyteu.../wp/tbwinre.zip

tblauncher.exe for 32bit WinPE.
tblauncher64.exe for 64bit WinPE.

So now we have a good standalone FREE app launcher for whichever architecture we want!
:clap:

http://reboot.pro/to...e-4#entry166910

This guy also managed to get it going nicely:
http://forums.mydigi...ll=1#post697187

 

UEFI + BIOS bootable USB-stick with Win8 Recovery folder sources\boot.wim

is made with few mouseclicks in Win 8 Configuration > Recovery menu

I have made TBx64.exe AutoIt3 program and added to system32 in Win8 Recovery boot.wim
Remove winpeshl.ini and add modified startnet.cmd to launch TBx64.exe and Recovery Environment.

TBx64.exe will search for TBLauncher64.exe found e.g. in in root of USB-stick.
All Apps can be in root of USB-stick and launched from TBLauncher Menu.

On booting from USB-stick then Recovery environment appears auto with TBLauncher Menu.
One can launch e.g. WinNTSetup2_x64.exe and prepare drive for install of any Windows e.g. XP

attachicon.gifW8_REC.jpg

I would like to make better picture.
Do you know PrintScreen program that works in x64 Win8 Recovery environment ?

:cheers:

Download TBx64.7z from http://www.mediafire.../?233dka636369k

http://reboot.pro/to...e-4#entry166946

 

Hello Everyone....

I want to create 'TBLx86_boot.wim' and 'TBLx64_boot.wim' in such a way so that both contains following 'Portable Apps' and
'Drivers'. And Both will show 'TBLauncher' within Windows Recovery Environment (Troubleshoot Screen). So that I can use

'WinNTSetup_v3.61_x86-x64' in order to install either 'WIMBoot' or 'WIMBoot + VHDX' into LOCAL HARDDISK' of PC/Tablets
in both UEFI (both x86 and x64) and BIOS mode.


1- Installed 'cfadisk' driver
2- File Manager
3- Explorer (x86-x64)
4- ImDisk (x86-x64)
6- BOOTICE v1.321 (x86-x64)
5- WinNTSetup v3.61 (x86-x64)
7- Notepad ++
8- Command Prompt
9- Take Screenshot (x86-x64)
10- TeraCopy (x86-x64)
11- Everything (x86-x64)
12- Task Manager
13- Portable VLC Player
14- Foxit Reader (x86-x64)
15- Image for Windows
16- DaRT To-ols
17- System Recovery Options
18- Recover Files
19- Hardware Info
20- WS405

 

post-65263-0-38536600-1407393977.png

post-65263-0-86540500-1407393991.png

post-65263-0-00306400-1407394006.png

post-65263-0-53048400-1407394056.jpg

post-65263-0-62261400-1407394076.png

 

-------------------------------------------------------------------------------------------------------------------

\bootmgr.efi                     (may be Optional because according to 'cdob' it does not use at USB disk)
\efi\boot\bootia32.efi
\efi\boot\bootx64.efi
\efi\microsoft\w81x86.efi
\efi\microsoft\w81x64.efi
\efi\microsoft\boot\bcd_Win8.1U1_Installer 
(Relocated to 'boot.sdi and TBLx86_boot.wim' and 'boot.sdi and TBLx64_boot.wim')
\boot\boot.sdi
\sources\TBLx86_boot.wim 
(with a bootable index)
\sources\TBLx64_boot.wim (with a bootable index)
\sources\w8186.exe
\sources\w8164.exe
\sources\install.wim      
(want to use only 32-bit 'install.wim' file, But if not possible then have to use combined x86-x64 'install.wim' file )
------------------------------------------------------------------------------------------------------------------

 

I will also use 'TBLx86_boot.wim' and 'TBLx64_boot.wim' in order to extract/install 32-bit Win 8.1 U1 'install.wim' into Local Hard disk of PC/Tablet in both UEFI (both x86 and x64) and BIOS mode.

If anybody know about the whole procedure for creating 'TBLx86_boot.wim' and 'TBLx64_boot.wim' , then please tell me about the Step by Step procedure.


Thanks in Advance..............

Regards............

Attached Thumbnails

  • 1.png
  • 2.png
  • 3.png
  • 4.jpg
  • 5.png


#28 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 06 August 2014 - 10:25 PM

It means both 'x86_boot.wim' and 'x64_boot.wim' may be same if we copy required 64-bit UEFI files into 'x86_boot.wim' .

And then we can also use modified 'x86_boot.wim' in order to UEFI booting in x64-firmware/system. But for it we have to points efi\microsoft\boot\bcd to 'winload.efi' from within the modified 'x86_boot.wim' instead of 'winload.exe'.

Can you describe more detailed?
Which steps are required to boot a x86 boot.wim at amd64 hardware?

I get a error 0xc0000359 ntoskrnl.exe could not be loaded.
Read the x86 kernel fails at UEFI amd64 boot.
identifier              {5cd15b26-1c1c-11e4-96c1-000c29eec2b3}
device                  ramdisk=[F:]\sources\boot_x86.wim,{ramdiskoptions}
path                    \windows\system64\winload.efi
description             UEFI_P1: boot_x86.wim  system64\winload.efi
osdevice                ramdisk=[F:]\sources\boot_x86.wim,{ramdiskoptions}
systemroot              \windows
detecthal               Yes
winpe                   Yes
What's the reason to support x86 at UEFI?
I expect 4 GB RAM at a UEFI machine.

#29 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 07 August 2014 - 02:18 AM

@cdob

 

http://reboot.pro/to...e-2#entry186272

 

Regards.....



#30 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 31 August 2014 - 10:12 AM

I always use of VHDX along with WIMBoot because it provide following side advantages to me - 

 

1- In case of 'WTG + WIMBoot + VHDX' , VHDX reduces overall Windows Installation time because during Installation I put VHDX within Hard disk and when Installation become complete then I copy VHDX from Hard disk to USB Drive. If I don't use VHDX then Windows Installation take hours. Actually I use very complex Multiboot configuration in my USB Drive. In case WIMBoot become corrupt then I don't have to format whole USB Partition. I only delete VHDX file and re-install windows within it. Suppose currently I am booting from 'WTG + WIMBoot + VHDX' and I want to re-install WIMBoot within USB drive. So there is neither need to format whole USB partition nor restart System multiple times. I will create a different VHDX file within USB drive and install windows within it. And after one restart second VHDX will become ready to use. I can copy IMP. data from 1st VHDX to 2nd VHDX easily. And then can delete 1st VHDX without any problem. 

       So, If I use VHDX along with WIMBoot, then it save overall Windows Installation time, allow easy re-installation of WIMBoot without any hard work, better management of Windows Installation.

 

2- In case of 'WIMBoot + VHDX', VHDX allow me to have Dual/Triple OS in a single Partition of my Internal Hard disk. And there is no need to keep one OS in one partition. And there is no need to format any partition of Internal hard disk again and again. I format only VHDX in order to re-install various WIMBoot's within C: drive of my system. I use AIO 'install.wim' file in my C: drive along with both 'Win8.1Pro.vhdx' and 'Win8.1Ent.vhdx'. So if one OS will become corrupt then at lease 2nd OS work properly.

 

3- I can copy 'install.wim + VHDX + Boot files' from Hard disk to USB and vice-versa during emergency. 

 

4- We can also transfer 'WIMBoot + VHDX' form one PC to another PC just by copy paste process. And there is no need to repeat whole windows installation again and again.

 

Note- I always use dynamically VHDX files because it doesn't consume unnecessary space within drives. 

 

Regards............ 



#31 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 31 August 2014 - 10:13 AM

Hello Everyone......

 

Sometime before I got a 'USB.zip' from here which contains following files within efi\microsoft\ directory-

 

post-65263-0-80684800-1409501268.png

 

Can anybody please tell me about the use/role of above .efi files during UEFI Booting

 

Regards...

Attached Thumbnails

  • HALIKUS EFI FILES.png


#32 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 31 August 2014 - 03:19 PM

Hello Everyone.....
 
I have three partition in my removable USB drive as follows-
 
PTN 1 - FAT32  -   5 GB   -  DATA
PTN 2 - FATE2  - 10 GB   -  E2B
PTN 3 -  NTFS   - 15 GB   -  WIN
 
And I have 'SMART USB' directory within Internal Hard disk which contains three sub-directories as follows-
 
\SMART USB\DATA
\SMART USB\E2B
\SMART USB\WIN
\SMART USB\SMART_USB.cmd
\SMART USB\SMART_USB_Shortcut.cmd
\SMART USB\SMART_USB_Shortcut.vbs
 
I want to create a 'SMART_USB.cmd' which will perform following functions-
 
1- Delete all content of 'PTN 1' and copy content of '\SMART USB\DATA' folder into root of 'PTN 1'
2- Make 'PTN 2' visible to Windows
3- Delete all content of 'PTN 2' and copy content of '\SMART USB\E2B' folder into root of 'PTN 2'
4- Make 'PTN 3' visible to Windows
5- Delete all content of 'PTN 3' and copy content of '\SMART USB\WIN' folder into root of 'PTN 3'
6- Make 'PTN 1' visible to Windows
 
Should I use 'altmbr.bin' from SYSLINUX package which allows to boot partition by number  ?
 
Can anybody help me in finding CMD commands which will Unhide Hidden Partition (PTN2/PTN3/PTN1)' ?
 
Thanks in Advance


#33 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 01 September 2014 - 02:53 AM

Finally I got my new 'SMART_USB.cmd'.

 

Thousands of thanks to 'steve6375' for providing required code lines.....

@ECHO Off
cls

:: set cmd shell window size
mode con: cols=100 lines=15

SETLOCAL ENABLEEXTENSIONS
color 48

popd
pushd "%~dp0"
if exist "%systemdrive%\Program Files\RMPrepusb\RMPartusb.exe"  pushd "%systemdrive%\Program Files\RMPrepusb"
if exist "%systemdrive%\Program Files (x86)\RMPrepusb\RMPartusb.exe" pushd "%systemdrive%\Program Files (x86)\RMPrepusb"
if not exist RMPARTUSB.exe echo Please install RMPrepUSB to the standard Program Files location & echo OR copy RMPartUSB.exe to %~dp0! & pause & goto :end


echo ____________________________________________________________________________________________________
echo ___________________________________,*"*._ Welcome KRISHNA _.*"*,________________________________________________________________________________________________________________________________________
echo.
:: echo SELECT A USB DRIVE
:: echo ==================
echo.
rmpartusb% LIST | find "DRIVE"
echo.
echo.
set DD=
set /P DD=Please enter your lucky number: 
set /a DD=DD
if "%DD%"=="" goto :end
if "%DD%"=="0" goto :end

set USBDRIVELETTER=
REM get the drive letter of the newly formatted drive
FOR /F "tokens=*" %%A IN ('RMPARTUSB DRIVE^=%dd% GETDRV') DO %%A
If "%USBDRIVELETTER%"=="" goto :EOF

cls




::re-order partitions into correct order
RMPARTUSB drive=%DD% FIRSTPART=0 SURE

:: Erase all files and folders of 'PTN 1'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: copy content of '\SMART USB\DATA' folder to root of 'PTN 1'
Echo copying "%~dp0DATA" to %USBDRIVELETTER%
xcopy /herky "%~dp0DATA\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN1'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul




::set partition 2 (2nd partition) as the accessible partition
RMPARTUSB drive=%DD% FIRSTPART=2 SURE

:: Erase all files and folders of 'PTN 2'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: copy content of '\SMART USB\E2B' folder to root of 'PTN 2'
Echo copying "%~dp0E2B" to %USBDRIVELETTER%
xcopy /herky "%~dp0E2B\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN2'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul




::set partition 3 (3nd partition) as the accessible partition
RMPARTUSB drive=%DD% FIRSTPART=3 SURE

:: Erase all files and folders of 'PTN 3'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: copy content of '\SMART USB\WIN' folder into root of 'PTN 3'
Echo copying "%~dp0WIN" to %USBDRIVELETTER%
xcopy /herky "%~dp0WIN\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN 3'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul




::re-order partitions into correct order
RMPARTUSB drive=%DD% FIRSTPART=0 SURE

cls

Cheers........



#34 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 01 September 2014 - 05:46 AM

I want to backup MBR to LBA31, LBA32 and LBA33 whenever PTN1, PTN2 and PTN3 become accessible to Windows. 

 

So what code should I use in place of  '????' ?

::re-order partitions into correct order
RMPARTUSB drive=%DD% FIRSTPART=0 SURE

::Backup MBR to LBA31
        ????


::set partition 2 (2nd partition) as the accessible partition
RMPARTUSB drive=%DD% FIRSTPART=2 SURE

::Backup MBR to LBA32
        ????


::set partition 3 (3nd partition) as the accessible partition
RMPARTUSB drive=%DD% FIRSTPART=3 SURE

::Backup MBR to LBA33
        ????


::re-order partitions into correct order
RMPARTUSB drive=%DD% FIRSTPART=0 SURE

cls

Please help me.......



#35 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 02 September 2014 - 02:04 PM

Finally I got RMPARTUSB code lines in order to backup MBR from LBA0 to LBA31, LBA32 and LBA33 whenever PTN1, PTN2 and PTN3 become accessible to Windows. So now my new 'SMART_USB.cmd' is -

@ECHO Off
cls

:: set cmd shell window size
mode con: cols=100 lines=15

SETLOCAL ENABLEEXTENSIONS
color 48


popd
pushd "%~dp0"
if exist "%systemdrive%\Program Files\RMPrepusb\RMPartusb.exe"  pushd "%systemdrive%\Program Files\RMPrepusb"
if exist "%systemdrive%\Program Files (x86)\RMPrepusb\RMPartusb.exe" pushd "%systemdrive%\Program Files (x86)\RMPrepusb"
if not exist RMPARTUSB.exe echo Please install RMPrepUSB to the standard Program Files location & echo OR copy RMPartUSB.exe to %~dp0! & pause & goto :end


echo ____________________________________________________________________________________________________
echo ___________________________________,*"*._ Welcome KRISHNA _.*"*,________________________________________________________________________________________________________________________________________
echo.
:: echo SELECT A USB DRIVE
:: echo ==================
echo.
rmpartusb% LIST | find "DRIVE"
echo.
echo.
set DD=
set /P DD=Please enter your lucky number: 
set /a DD=DD
if "%DD%"=="" goto :end
if "%DD%"=="0" goto :end

set USBDRIVELETTER=
REM get the drive letter of the newly formatted drive
FOR /F "tokens=*" %%A IN ('RMPARTUSB DRIVE^=%dd% GETDRV') DO %%A
If "%USBDRIVELETTER%"=="" goto :EOF

cls


::Re-order Partitions into correct order
RMPARTUSB DRIVE=%DD% FIRSTPART=0 SURE

::Backup MBR to LBA31
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x31.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x31.bin" FILESTART=0 USBSTART=31 LENGTH=1SEC SURE

:: Copy content of '\SMART USB\DATA' folder to root of 'PTN 1'
Echo copying "%~dp0DATA" to %USBDRIVELETTER%
xcopy /herky "%~dp0DATA\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN1'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul



::Set Partition 2 (2nd Partition) as the accessible Partition
RMPARTUSB DRIVE=%DD% FIRSTPART=2 SURE

::Backup MBR to LBA32
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x32.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x32.bin" FILESTART=0 USBSTART=32 LENGTH=1SEC SURE

:: Erase all files and folders of 'PTN 2'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: Copy content of '\SMART USB\E2B' folder to root of 'PTN 2'
Echo copying "%~dp0E2B" to %USBDRIVELETTER%
xcopy /herky "%~dp0E2B\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN2'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul



::Set Partition 3 (3nd Partition) as the accessible Partition
RMPARTUSB DRIVE=%DD% FIRSTPART=3 SURE

::Backup MBR to LBA33
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x33.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x33.bin" FILESTART=0 USBSTART=33 LENGTH=1SEC SURE

:: Erase all files and folders of 'PTN 3'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: Copy content of '\SMART USB\WIN' folder into root of 'PTN 3'
Echo copying "%~dp0WIN" to %USBDRIVELETTER%
xcopy /herky "%~dp0WIN\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN 3'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul



::Re-order Partitions into correct order
RMPARTUSB DRIVE=%DD% FIRSTPART=0 SURE

cls

Cheers...... :) 



#36 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 September 2014 - 03:43 AM

I use 'GetLine.cmd' along with 'Restore_PTN.cmd' and 'SMART_USB.cmd' in order to set 'Master Password' for authentication. 

 

                                                                        GetLine.cmd                                                                           

:: GetLine - no echo, use for getting a passphrase

:: Usage:  call GetLine.cmd
::         if not "%Line%"=="Secret password" goto :EOF
::
:: Returns:  %Line%
:: echo's * for each character entered by user
:: can use <backspace> key
:: press enter to finish input

   @Echo Off   
   :HInput
   ::Version 3.0     
   SetLocal DisableDelayedExpansion
   Set "Line="
   Rem Save 0x08 character in BS variable
   For /F %%# In (
   '"Prompt;$H&For %%# in (1) Do Rem"'
   ) Do Set "BS=%%#"

   :HILoop
   Set "Key="
   For /F "delims=" %%# In (
   'Xcopy /L /W "%~f0" "%~f0" 2^>Nul'
   ) Do If Not Defined Key Set "Key=%%#"
   Set "Key=%Key:~-1%"
   SetLocal EnableDelayedExpansion
   If Not Defined Key Goto :HIEnd
   If %BS%==^%Key% (Set /P "=%BS% %BS%" <Nul
   Set "Key="
   If Defined Line Set "Line=!Line:~0,-1!"
   ) Else Set /P "=*" <Nul
   If Not Defined Line (EndLocal &Set "Line=%Key%"
   ) Else For /F delims^=^ eol^= %%# In (
   "!Line!") Do EndLocal &Set "Line=%%#%Key%"
   Goto :HILoop
   :HIEnd
echo.
endlocal& endlocal& set Line=%Line%



#37 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 September 2014 - 10:41 AM

@tblo

Hi.......
I am also using slightly modified 'RestoreMBR'. Actually following is the whole setup which I always keep within 'SMART USB' directory within my PC.


SMART USB\DATA                                               (For Storage Purposes)
SMART USB\E2B                                                   (Contains E2B files along with all .imgPTN payload files and Imp. software and drivers)
SMART USB\WIN                                                  (Contains boot.wim , install.wim , vhdx etc...)
SMART USB\DEV\RestorePTN.exe
SMART USB\E2B\RestorePTN.exe
SMART USB\WIN\RestorePTN.exe
SMART USB\GetLine.cmd
SMART USB\grubinst.exe
SMART USB\grubinst_new.exe
SMART USB\LockDismount.exe
SMART USB\MSVBVM60.DLL
SMART USB\RMPARTUSB.exe
SMART USB\SMART_USB.cmd                             (It create my whole 'SMART USB' by just one click )
SMART USB\SMART_USB_Shortcut.cmd             (It create 'SMART USB' shortcut in Desktop)
SMART USB\SMART_USB_Shortcut.vbs
SMART USB\touchdrv.exe

Note- 

1- My all .imgPTN payload files already contains 'RestorePTN.exe'RestorePTN.exe contains following files-

RMPARTUSB.exe
MSVBVM60.DLL
GetLine.cmd
Restore_PTN.cmd

2- I also have to keep a .txt file in following format along with all .imgPTN payload files (Except WTG.imgPTN) in order to backup CSM-MBR of each.imgPTN payload files. So that I can switch to any .imgPTN within from UEFI System without changing BIOS mode..

e.g.

Win7Ult-SP1-x86-Mar2014.txt

title Win 7 Ultimate\n  
/%grub%/qrun.g4b $HOME$/Win7Ult-SP1-x86-Mar2014.imgPTNAUTO
dd if=(hd0)+1 of=(hd0)37+1
boot

Win81AIO-S14-20in1-x86-en-US-Mar2014.txt

title Win 8.1 Update 1\n  
/%grub%/qrun.g4b $HOME$/Win81AIO-S14-20in1-x86-en-US-Mar2014.imgPTNAUTO
dd if=(hd0)+1 of=(hd0)38+1
boot

When I want to to re-create my fully working 'SMART USB' , then I just have to double click 'SMART USB' shortcut in the Desktop. And then 'SMART_USB.cmd' ask for USB selection just after 'Master Password' authentication (Password = fred). After choosing desired USB Drive it first delete all previous contents of PTN2 and PTN3. After that it automatically copy contents of DATA, E2B and WIN folders intoPTN1, PTN2 and PTN3 of my USB Drive respectively. It also set hidden attribute to each files and folders except 'SMART_PTN.exe'.

 

 

                                                                         SMART_USB.cmd                                                                          

@ECHO Off
cls

:: set cmd shell window size
mode con: cols=100 lines=15

SETLOCAL ENABLEEXTENSIONS
color 9F

call :check_Permissions
if "%ADMIN%"=="FAIL" goto :EOF



pushd "%~dp0"
:plp
cls
echo._______________________________________________________________________________________________________________________________________                             ____________________________________                                    *"*._ Welcome KRISHNA _.*"*                           
echo.
echo.
echo.
echo.	
echo                                    *****************************
echo ----------------------------------- LET'S DO SOMETHING SPECIAL! ------------------------------------                                   *****************************                                                                                        
echo.
echo.
echo.
call GetLine.cmd
if /i "%Line%"=="abort" exit /b
if /i not "%Line%"=="fred" goto :plp
cls



if exist "%systemdrive%\Program Files\RMPrepusb\RMPartusb.exe"  pushd "%systemdrive%\Program Files\RMPrepusb"
if exist "%systemdrive%\Program Files (x86)\RMPrepusb\RMPartusb.exe" pushd "%systemdrive%\Program Files (x86)\RMPrepusb"
if not exist RMPARTUSB.exe echo Please install RMPrepUSB to the standard Program Files location & echo OR copy RMPartUSB.exe to %~dp0! & pause & goto :end




echo._______________________________________________________________________________________________________________________________________                             ____________________________________                                    *"*._ Welcome KRISHNA _.*"*                           
echo.
echo.
:: echo SELECT A USB DRIVE
:: echo ==================
echo.
rmpartusb% LIST | find "DRIVE"
echo.
echo.
set DD=
set /P DD=Please choose your desired USB Drive: 
set /a DD=DD
if "%DD%"=="" goto :end
if "%DD%"=="0" goto :end

set USBDRIVELETTER=
REM get the drive letter of the newly formatted drive
FOR /F "tokens=*" %%A IN ('RMPARTUSB DRIVE^=%dd% GETDRV') DO %%A
If "%USBDRIVELETTER%"=="" goto :EOF


cls


::Re-order Partitions into correct order
RMPARTUSB DRIVE=%DD% FIRSTPART=0 SURE

::Backup MBR to LBA29
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x29.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x29.bin" FILESTART=0 USBSTART=29 LENGTH=1SEC SURE

:: Copy content of '\SMART USB\DEV' folder to root of 'PTN 1'
Echo copying "%~dp0DEV" to %USBDRIVELETTER%
xcopy /herky "%~dp0DEV\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN1'
attrib +h +r +s /s /d %USBDRIVELETTER%\"EFI" >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul
attrib -h -s /s /d %USBDRIVELETTER%\"Welcome" >nul 2>nul




::Set Partition 2 (2nd Partition) as the accessible Partition
RMPARTUSB DRIVE=%DD% FIRSTPART=2 SURE

::Backup MBR to LBA32
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x32.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x32.bin" FILESTART=0 USBSTART=32 LENGTH=1SEC SURE

:: Erase all files and folders of 'PTN 2'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: Copy content of '\SMART USB\E2B' folder to root of 'PTN 2'
Echo copying "%~dp0E2B" to %USBDRIVELETTER%
xcopy /herky "%~dp0E2B\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN2'
attrib +h +r +s /s /d %USBDRIVELETTER%\_ISO >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\Efi >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\"Smart Apps" >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\autorun.inf >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\autounattend.xml >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\e2b.ico >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\FASTLOAD.YES >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\grldr >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\HitmanPro.exe >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\HitmanPro_x64.exe >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\Kickstarter.exe >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\menu.lst >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\PassPass.bak >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\ReadMe.txt >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\unattend.xml >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\SMART_USB.cmd >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\SMART_USB_Shortcut.cmd >nul 2>nul
attrib +h +r +s /s /d %USBDRIVELETTER%\SMART_USB_Shortcut.vbs >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul
attrib -h -s /s /d %USBDRIVELETTER%\"Welcome" >nul 2>nul




::Set Partition 3 (3nd Partition) as the accessible Partition
RMPARTUSB DRIVE=%DD% FIRSTPART=3 SURE

::Backup MBR to LBA33
RMPARTUSB DRIVE=%DD% USBTOFILE FILE="x33.bin" FILESTART=0 USBSTART=0  LENGTH=1SEC SURE
RMPARTUSB DRIVE=%DD% FILETOUSB FILE="x33.bin" FILESTART=0 USBSTART=33 LENGTH=1SEC SURE

:: Erase all files and folders of 'PTN 3'
rd /q /s %USBDRIVELETTER%\
attrib /S -r -a -h -s %USBDRIVELETTER%\*.*
del /S /q %USBDRIVELETTER%\*.*
rd /s /q %USBDRIVELETTER%\*.*

:: Copy content of '\SMART USB\WIN' folder into root of 'PTN 3'
Echo copying "%~dp0WIN" to %USBDRIVELETTER%
xcopy /herky "%~dp0WIN\*.*" "%USBDRIVELETTER%\*.*"

::  Apply attribute commands to the content of 'PTN 3'
attrib +h +r +s /s /d %USBDRIVELETTER%\*.* >nul 2>nul
attrib +h -r -s /s /d %USBDRIVELETTER%\Welcome.exe >nul 2>nul
attrib -h -s /s /d %USBDRIVELETTER%\"Welcome" >nul 2>nul




::Re-order Partitions into correct order
RMPARTUSB DRIVE=%DD% FIRSTPART=0 SURE





REM install grub4dos - use new grubinst to install to PBR
echo Installing grub4dos to PBR of %USBDRIVELETTER%...
set GR=grubinst_new.exe

if "%dd%"=="0" exit

REM Dismount the drive, run grubinst, remount the drive
"%~dp0LockDismount.exe" -force %dd% %GR% -t=0 --install-partition=1 (hd%dd%)
If errorlevel 1 color 4f & pause & exit
REM use touchdrv to ensure MBR changes are not removed by Windows!
touchdrv %USBDRIVELETTER%


REM also install to MBR
echo.
echo Installing grub4dos to MBR of %USBDRIVELETTER%...
set GR=grubinst.exe
if %DD% GEQ 10 set GR=grubinst_new.exe
"%~dp0LockDismount.exe" -force %dd% %GR% -t=0 --skip-mbr-test (hd%dd%)
If errorlevel 1 color 4f & pause & exit
touchdrv %USBDRIVELETTER%


cls

                                                                           Restore_PTN.cmd                                                                          

@ECHO Off
cls

:: set cmd shell window size
mode con: cols=100 lines=15

SETLOCAL ENABLEEXTENSIONS
color 9F

call :check_Permissions
if "%ADMIN%"=="FAIL" goto :EOF


Echo copying %~dp0 to %SystemDrive%\e2b folder...
xcopy /herky "%~dp0*.*" "%SystemDrive%\e2b\*.*"



pushd "%~dp0"
:plp
cls
echo._______________________________________________________________________________________________________________________________________                             ____________________________________                                    *"*._ Welcome KRISHNA _.*"*                           
echo.
echo.
echo.
echo.	
echo                                    *****************************
echo ----------------------------------- LET'S DO SOMETHING SPECIAL! ------------------------------------                                   *****************************                                                                                        
echo.
echo.
echo.
call GetLine.cmd
if /i "%Line%"=="abort" exit /b
if /i not "%Line%"=="fred" goto :plp
cls



if exist "%systemdrive%\Program Files\RMPrepusb\RMPartusb.exe"  pushd "%systemdrive%\Program Files\RMPrepusb"
if exist "%systemdrive%\Program Files (x86)\RMPrepusb\RMPartusb.exe" pushd "%systemdrive%\Program Files (x86)\RMPrepusb"
if not exist RMPARTUSB.exe echo Please install RMPrepUSB to the standard Program Files location & echo OR copy RMPartUSB.exe to %~dp0! & pause & goto :end




echo._______________________________________________________________________________________________________________________________________                             ____________________________________                                    *"*._ Welcome KRISHNA _.*"*                           
echo.
echo.	
:: echo SELECT A USB DRIVE
:: echo ==================
echo.
rmpartusb% LIST | find "DRIVE"
echo.
echo.
set DD=
set /P DD=Please choose your desired USB Drive: 
set /a DD=DD
if "%DD%"=="" goto :end
if "%DD%"=="0" goto :end

set USBDRIVELETTER=
REM get the drive letter of the newly formatted drive
FOR /F "tokens=*" %%A IN ('RMPARTUSB DRIVE^=%dd% GETDRV') DO %%A
If "%USBDRIVELETTER%"=="" goto :EOF



:: echo Hide/Unhide 'Smart Apps' folder
:: echo ===============================
echo.
set ttt=%USBDRIVELETTER%\"Smart Apps"
attrib %ttt% | find " SHR " > nul & if  not errorlevel 1 goto :PTN

:: hide the folder
attrib +h +r +s /s /d %ttt%
goto :h1

:unhide
:: unhide the folder
attrib -h -s /s /d %ttt%
:h1



:PTN

:: --- RestorMBR ---

cls
color 9F

echo._______________________________________________________________________________________________________________________________________                             ____________________________________                                    *"*._ Welcome KRISHNA _.*"*                           
echo.	


echo. Choose a RestoreMBR Type:
echo.
echo.   1= Restore MBR from LBA30 [Data Partition will be visible to Windows]
echo.   2= Restore MBR from LBA32  [E2B Partition will be visible to Windows]
echo.   3= Restore MBR from LBA33  [WIN Partition wiil be visible to Windows]
echo.   A= Abort
echo. Esc= Switch to .imgPTN Partition Images


echo.
set ask=
if not "%AUTORUN%"=="1" set /p ask=WHERE YOU WANT TO SWITCH ?   
if /i "%ask%"=="A" goto :EOF

:: Set attribute to 'Smart Apps' folder and 'WELCOME.exe' file
attrib +h +r +s /s /d %USBDRIVELETTER%\"Smart Apps"
attrib +h /s /d %USBDRIVELETTER%\"WELCOME.exe"

cls

if /i "%ask%"=="2" goto :PTN2
if /i "%ask%"=="3" goto :PTN3
if /i "%ask%"==" " goto :CSMBR
if /i "%ask%"=="  " goto :unhide


set LBA=29
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

set LBA=30
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

set LBA=60
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

set LBA=1
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec
echo No backup MBR found! & pause & goto :end


:PTN2
:: --- set LBA 32
set LBA=32
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec


:PTN3
:: --- set LBA 33
set LBA=33
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec


:CSMBR
color 1F
:: --- Restor CSM-MBR ---
echo.
echo.
echo   Choose a CSM-MBR-
echo.
echo     1= Easy Rescue Suite 2014
echo     2= SB Golden Suite 2014
echo     3= Ultimate Super Smart Solution 2014
echo     4= Win7Ult-SP1-x86-Mar2014
echo     5= Win81AIO-S14-20in1-x86-en-US-Mar2014
echo     6= XXX Master Stroke 2014
echo     Y= Previous Partition Image
echo     A= Abort
echo.

set ask=
if not "%AUTORUN%"=="Y" set /p ask=WHERE YOU WANT TO SWITCH ?      
if /i "%ask%"=="1" goto :LBA34
if /i "%ask%"=="2" goto :LBA35
if /i "%ask%"=="3" goto :LBA36
if /i "%ask%"=="4" goto :LBA37
if /i "%ask%"=="5" goto :LBA38
if /i "%ask%"=="6" goto :LBA39
if /i "%ask%"=="A" goto :EOF
if /i "%ask%"==" " goto :PTN


cls


:: LBA31
set LBA=31
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

echo WARNING: No backup MBR found in LBA31 (please use latest version of E2B!)
if not exist %TEMP%\E2B0.TMP echo ERROR: No previous backup of CSM MBR found in %TEMP% folder! & pause & goto :end
echo.
echo Restoring MBR from %TEMP%\E2B0.TMP...
RMPARTUSB FILETOUSB drive=%DD% FILE="%TEMP%\E2B0.TMP" USBSTART=0  LENGTH=1SEC FILESTART=0 SURE > nul
if errorlevel 1 echo WRITE FAILED! & pause & goto :end
echo MBR Restored OK - please disconnect and re-connect the E2B drive now.
goto :end


:LBA34
:: LBA34 should contain a backup
set LBA=34
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

:LBA35
:: LBA35 should contain a backup
set LBA=35
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

:LBA36
:: LBA36 should contain a backup
set LBA=36
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

:LBA37
:: LBA37 should contain a backup
set LBA=37
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

:LBA38
:: LBA38 should contain a backup
set LBA=38
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

:LBA39
:: LBA39 should contain a backup
set LBA=39
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec



:: ------


:end
popd
endlocal
GOTO :EOF


:gotsec
RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% LENGTH=1SEC SURE
echo Found backup MBR at SECTOR %LBA%
echo.

:: MUST NOT USE USB drive to store .TMP file as RMPartUSB cannot access it after dismounting the volume!

:: Save LBA 0 to E2B0.TMP
RMPARTUSB USBTOFILE drive=%DD% FILE="%TEMP%\E2B0.TMP" USBSTART=0 LENGTH=1SEC FILESTART=0 SURE > nul

RMPARTUSB USBTOFILE drive=%DD% FILE="%TEMP%\E2B%LBA%.TMP" USBSTART=%LBA% LENGTH=1SEC FILESTART=0 SURE > nul
if errorlevel 1 goto :end
RMPARTUSB FILETOUSB drive=%DD% FILE="%TEMP%\E2B%LBA%.TMP" USBSTART=0  LENGTH=1SEC FILESTART=0 SURE > nul
if errorlevel 1 goto :end
echo MBR Restored OK
goto :PTN


:getsec
echo Checking LBA%LBA%...
FOR /F "tokens=16,17 delims=- " %%A IN ('RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% length=1sec sure`^| FIND "01F0"') DO (
if "*%%A*%%B*"=="*55*AA*" echo Found MBR & set MBR=1
)
FOR /F "tokens=4 delims=- " %%A IN ('RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% length=1sec sure`^| FIND "01C0"') DO (
if not "*%%A*"=="00" echo Found Partition 1 Entry & set PTN=1
)

goto :eof


:check_Permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
	REM --> If error flag set, we do not have admin.
	if '%errorlevel%' NEQ '0' (
        echo.
	echo Sorry - you need to run this script as Administrator.
        echo.
	echo Please use right-click - Run as administrator.
	echo.
	echo.
	color cf
	pause
	Set ADMIN=FAIL
    ) else (
	echo Administrative permissions confirmed.
    )

Cheers....



#38 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 15 November 2014 - 07:15 PM

Roaming between different firmware types

 

Windows supports two types of PC firmware: Unified Extensible Firmware Interface (UEFI), which is the new standard, and legacy BIOS firmware, which was used in most PCs shipping with Windows 7 or earlier version of Windows. Each firmware type has completely different Windows boot components that are incompatible with each other. Beyond the different boot components, Windows supports different partition styles and layout requirements for each type of firmware as shown in the following diagrams.

 

IC611724.gifIC611725.gif

 

This presented a unique challenge for Windows To Go because the firmware type is not easily determined by end-users—a UEFI computer looks just like a legacy BIOS computer and Windows To Go must boot on both types of firmware.

 

To enable booting Windows To Go on both types of firmware, a new disk layout is provided for Windows 8 that contains both sets of boot components on a FAT32 system partition and a new command-line option was added to bcdboot.exe to support this configuration. The /f option is used with the bcdboot /s command to specify the firmware type of the target system partition by appending either UEFIBIOS or ALL. When creating Windows To Go drives manually you must use the ALL parameter to provide the Windows To Go drive the ability to boot on both types of firmware. For example, on volume H: (your Windows To Go USB drive letter), you would use the command bcdboot C:\windows /s H: /f ALL. The following diagram illustrates the disk layout that results from that command:

 

IC611726.gif

 

This is the only supported disk configuration for Windows To Go. With this disk configuration, a single Windows To Go drive can be booted on computers with UEFI and legacy BIOS firmware.

 

Regards....



#39 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 15 November 2014 - 08:59 PM

Well, I guess that a link to the original source:

http://technet.micro...y/jj592685.aspx

http://technet.micro...px#stg_firmware

would have been nice. :whistling:

 

Otherwise the "supported by WHOM?" question would have been spontaneous....

 

 

:duff:

Wonko



#40 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 24 November 2014 - 03:18 PM

      Create Secret Win 8.1 U1 'WTG + WIMBoot + VHDX' Configuration within 'Removable USB Drive'       
 
 
1- Create 3 Partitions in your Removable USB Drive as follows with the help of BOOTICE.
 
PTN1 - FAT32 - DEV (Active)  - 1GB or Greater
PTN2 - FAT32 - E2B                - 1GB or Greater
PTN3 - NTFS  - WIN                - 10GB or Greater
 
2- Set FAT32 'E2B' Partition as Active and make NTFS 'WIN' Partition accessible to Windows with the help of BOOTICE.
 
PTN1 - NTFS  - WIN               - 10GB or Greater
PTN2 - FAT32 - E2B (Active)  - 1GB or Greater
PTN3 - FAT32 - DEV               - 1GB or Greater
 
3- Install 'Microdrive (cfadisk)' driver in your Main OS so that 'WinNTSetup v.3.7.5' can access all partition of
    Removable USB Drive. No need to restart your system, Just Re-plug your 'Removable USB Drive' and system
     will show all partitions of 'Removable USB Drive'.
 
4- Copy Win 8.1 Update 1 'install.wim' file within Root of NTFS 'WIN' Partition of Removable USB Drive.
     i.e. [WIN]:\install.wim
 
5- Now Run 'WinNTSetup v.3.7.5' and create Dynamically Expanding VHDX file within your Internal Hard Disk.
     i.e. C:\Windows X.vhd , which will be mounted automatically as Z: Drive.
 
6- Now Choose [WIN]:\install.wim as Source File, FAT32 'E2B' Partition as Boot Drive and Z: Drive as 
     Installation Drive.
 
7- Don't forget to check 'WIMBoot' check-box. After that press 'Setup' button and press 'OK' in order to extract contents
     of [WIN]:\install.wim file to Z [Windows X.vhd]: Drive
 
8- After completing copying process Restart your PC in order to start 'Sysprep' phase.
     Next Step is very IMPORTANT.........So be careful...
 
9- Now you have to Boot from your 'Removable USB Drive' successively 3 times whenever system will RESTART.
     So Please Boot from your 'Removable USB Drive' until your reach to Desktop of WTG.
 
10- After three successive booting from your 'Removable USB Drive', You will reach to the Desktop of WTG.
 
11- Now It's time to install 'Microdrive (cfadisk)' driver within Current Windows (Booted within from 'Windows X.vhd')
 
12- After Installing 'Microdrive (cfadisk)' Restart your System and 'Boot from your Internal Hard Disk'.
 
13- Now copy C:\Windows X.vhd file to the Root of NTFS [WIN]: Partition of your Removable USB Drive.
 
14- Now Run Command Prompt as Admin and execute following command :
 
attrib -h -r -s /s /d K:\*.*
 
      Where K: is Drive letter of FAT32 'E2B' Partition of your 'Removable USB Drive'.
 
15- Now RELOCATE both K:\Boot\BCD and K:\EFI\microsoft\Boot\BCD to NTFS 'WIN' Partition of 'Removable USB
       Drive' and press 'Save Globals' button. (This is very Important Step so be Careful.) 
 
16- Now Uninstall 'Microdrive (cfadisk)' driver within from your Main OS....(No need to restart System just Re-plug
       Removable USB Drive in order to Apply Changes). Now you will see only one partition of your 'Removable USB Drive'.  
 
17- Now open BOOTICE/Part Manager once again and make FAT32 'DEV' Partition accessible to Windows in
      following manner - (Play with 'Set Accessible' Button until you get exact following Partition Sequence because
      sometimes it become RANDOM during swapping of Partitions. So It may be Play time if you are lucky....)
 
PTN1 - FAT32 - DEV               - For Data Storage 
PTN2 - FAT32 - E2B (Active)  - 'Boot Files' + 'EFI' Files
PTN3 - NTFS   - WIN               - \install.wim + \Windows X.vhd
 
18- Now Boot from your 'Removable USB Drive' and you will Boot to Complete "WTG + WIMBoot + VHDX" 
       configuration if you will be LUCKY....
 
19- CONGRATULATIONS........... DONE........It's Coffee time..........
 
 
Optional-  If you have successfully boot to "WTG + WIMBoot + VHDX' configuration. Then you can also test
                   following Steps -
 
1- Create 'E2B' and 'WIN' folder in the Desktop of your Main OS. 
2- Copy all contents of 'E2B' Partition to 'E2B' folder and all contents of 'WIN' Partition to 'WIN' folder.
3- Now format both 'E2B' Partition and 'WIN' Partitions. (There should not be any change in Physical Partition Table.)
4- Now Copy all contents of 'E2B' folder to 'E2B' Partition and 'WIN' folder to 'WIN' Partition.
5- And Re-arrange all Partition of 'Removable USB Drive' in following sequence once again-
 
PTN1 - FAT32 - DEV               - For Data Storage 
PTN2 - FAT32 - E2B (Active)  - 'Boot Files' + 'EFI' Files
PTN3 - NTFS   - WIN               - \install.wim + \Windows X.vhd
 
6- Now Boot from your 'Removable USB Drive'. It will still successfully Boot "WTG + WIMBoot + VHDX' configuration.
     WELL DONE
 
THANKS & REGARDS.......  :) .

  • r0manas likes this

#41 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 28 November 2014 - 07:25 PM

       Install Filter Driver (cfadisk) within 'Boot.wim' On-the-FLY       

 

1- First download 'Mount.zip' from HERE

2- Create a folder 'Mount WIM' in the root of C: Drive.

3- Mount Index #2 Image of \sources\boot.wim to 'C:\Mount WIM' folder with the help of either 'DISM GUI 4.0'

     or 'GImageX v2.1.1' Tool.

4- Extract all files of 'Mount.zip' to 'C:\Mount WIM' folder

5- Dismount \sources\boot.wim

6- Now \sources\boot.wim is ready to load 'install.wim' file within from ANY Partition of 'Removable USB Drive'

7- Done.......

 

And now you can boot both 32 Bit 'Boot.wim' and 64-Bit 'Boot.wim' ("testsigning" option must be enable in BIOS BCD & UEFI BCD) within from any Partition (PTN1/PTN2/PTN3/PTN4) of your 'Removable USB Drive' in order to load 'install.wim' file within from any Partition (PTN1/PTN2/PTN3/PTN4) of your 'Removable USB Drive' in both BIOS and UEFI (Secure Boot Disablemode.

 

Cheers.... :) 

Attached Files


  • r0manas likes this

#42 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 28 November 2014 - 08:01 PM

2- Mount \sources\boot.wim to 'C:\Mount WIM' folder
...
4- Dismount \sources\boot.wim

Posting how exactly to do this mounting/dismounting would probably be appreciated. :)


I am not sure to understand the reason for 


cmd /q /c "FOR %%i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %%i:\AUTO.CMD cmd /k %%i:\AUTO.cmd"
in mysetup.cmd, when everything else is "hardcoded" to paths on the X: drive.
 
JFYI, the IF EXIST will throw an error on machines with "multi card readers", see:
http://www.msfn.org/...e-3#entry987564
 
:duff:
Wonko

#43 steve6375

steve6375

    Platinum Member

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

Posted 29 November 2014 - 01:39 PM

Has anyone tried this?

 

I have done this using an AutoUnattend.xml from a removable drive and an unmodified Win8 ISO file.

drvload runs ok but it says it needs a reboot to take affect (which I obviously cannot do with WinPE).

 

The other partition on the USB removable drive does not appear  until I unplug the USB drive and re-insert it.



#44 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 29 November 2014 - 04:18 PM

Has anyone tried this?
 
I have done this using an AutoUnattend.xml from a removable drive and an unmodified Win8 ISO file.
drvload runs ok but it says it needs a reboot to take affect (which I obviously cannot do with WinPE).
 
The other partition on the USB removable drive does not appear  until I unplug the USB drive and re-insert it.

I am not sure to understand your report/the issue :unsure:.

Though it is not entirely clear, the approach devadev explained is about a "preliminary step" to modify (offline) the boot.wim BEFORE adding it to an USB stick.

Once you have run drvload and unmounted the boot.wim, the next time you boot from the boot.wim it should be able to have the cfadisk installed and thus see the non-first partition. (there is no unplugging and re-plugging of anything involved and the boot.wim is not booted into until after having being modified).

:duff:
Wonko

#45 steve6375

steve6375

    Platinum Member

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

Posted 29 November 2014 - 04:26 PM

No, that is not what devs mod does.

If you look at the download, it just adds a winpeshl.ini file which runs a batch file when WinPE boots.

So cfadisk driver is not installed until boot time (each and every time WinPE boots, drvload is run).

 

The difference seems to be that when I run drvload (win 8 x86), it says it installed correctly but that a reboot is required, with devadev's WinPE, it does not say that a reboot is required.


  • devdevadev likes this

#46 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 29 November 2014 - 06:06 PM

The difference seems to be that when I run drvload (win 8 x86), it says it installed correctly but that a reboot is required, with devadev's WinPE, it does not say that a reboot is required.


Now I see. :), my bad  :blush: 

drvload in itself:
http://msdn.microsof...bedded.60).aspx
should not even work if a reboot is actually needed. :unsure:

It is entirely possible that the message you get is a "deceiving" one, maybe it is the Win8 that behaves "strangely".

And to add a filter driver a reboot should not actually be needed, though the "unplug and re-plug" should actually be needed (or maybe killing and restarting the current shell would do as well).

All in all I would actually see if it is possible to add the cfadisk (or dummydisk or diskmod) to the offline PE in boot.wim (i.e. without using drvload, but rather DISM), I mean it is not like "as is" you have a choice to install or not install the filter driver and the on-the-fly installation would make sense only if needed on some systems and not needed on others, but off hand I cannot see any particular reason to NOT have such a filter driver installed.  :dubbio:

But about a "load filter driver on demand", there was a similar attempt some time ago, never finalized:
http://reboot.pro/to...-disk/?p=176958
and another one:
http://reboot.pro/to...filter-drivers/
 
You could try playing a bit with devcon, as hinted in the above, it is possible that a reboot (as well as the unplug/replug) can be simulated (or maybe it is possible to always pre-install a "actually dummy" filter driver and only replace it without a reboot when needed), but I have no idea on where to find such "do nothing" "placeholder" or how to build one. :ph34r:):
http://msdn.microsof...er_driver_tools
 
:duff:
Wonko

#47 steve6375

steve6375

    Platinum Member

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

Posted 29 November 2014 - 06:40 PM

I tried devadev's method using Win 8.1 x86 boot.wim and it worked.

The screenshot shows that no reboot message occurred and the REM_PTN2 which was the 2nd partition on the removable flash drive was visible after the driver was installed.

It does seem to completely change the drive letters though!!!! presumably because the removable drive is now seen as a hard drive.

 

So there must be a difference somewhere in timing using the winpeshl.ini  [LaunchApps] section  compared to when the \AutoUnattend.xml detection starts.

 

I think the winpeshl.exe first looks for winpeshl.ini - if it exists then it runs it and theAuto,cmd and then runs setup so no shell is launched. If it does not exist it runs wpeinit (from startnet.cmd) which then looks for \Autounattend.xml.

 

This is a shame as I was hoping to use the driver with \AutoUnattend.xml so I could add cfadisk to any Windows Install ISO without needing to open the ISO at all!

 

P.S. The reason why devadev likes this method is that it should (??) not break Secure Boot if used in a EUFI payload as the driver is unsigned. If it was added into the WinPE itself, then you would also need to fiddle with the BCD, etc.

Attached Thumbnails

  • CaptureKrishna.jpg

  • devdevadev likes this

#48 steve6375

steve6375

    Platinum Member

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

Posted 29 November 2014 - 06:56 PM

@Wonko - thanks, I tried using devcon and other utilities to dismount/remount, etc. but none worked.

The only thing that works is unplugging and re-connecting the USB drive when running drvload via the \AutoUnattend.xml method) :frusty:



#49 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 29 November 2014 - 07:23 PM

@Wonko - thanks, I tried using devcon and other utilities to dismount/remount, etc. but none worked.
The only thing that works is unplugging and re-connecting the USB drive when running drvload via the \AutoUnattend.xml method) :frusty:

But it is strange that it cannot be (one way or the other :ph34r:) "simulated", see if this works:
http://digital.ni.co...62573A700602459

About drive lettering change, I can see that it is *needed*.
In the \DosDevices Registry key a "Removable" USB stick will have an entry starting with "\??\STORAGE#RemovableMedia#" while a "fixed one" will have the "usual" DiskSignature+start offset
http://www.911cd.net...showtopic=19663

But maybe one could try a trick or two with mountvol (or similar) to remove the drive letter before disabling and re-detecting the stick :unsure: (or even recreating the drive letter assignment by direct Registry editing using the appropriate DiskSignature+start offset sintax)

:duff:
Wonko

#50 steve6375

steve6375

    Platinum Member

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

Posted 29 November 2014 - 07:28 PM

Yes, I tried that. No joy.







Also tagged with one or more of these keywords: multi boot, dual partition, grub4dos, easy2boot, removable usb drive, iso image, uefi, uefi multi.exe, usb booting, winntsetup 3

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users