Jump to content











Photo
- - - - -

UEFI Bootmgr Wipe Ideas


  • Please log in to reply
31 replies to this topic

#26 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 13 July 2016 - 05:52 PM

This time I used un untouched boot.wim image from Windows 8.0 ADK via copype amd64
And created the bootable iso image using oscdimg -lBUPE -h -n -m -b"etfsboot.com" -b"efisys.bin" C:\_TEMP C:\BUPE.iso
 
At first I only tried it with etfsboot.com. Then I tried the command with both etfsboot.com and efisys.bin. Same thing, it freezes in UEFI mode. It's got to be something I've missed. I know the original windows 8 DVD works file. It probably is some stupid driver that cannot be initialized.


I don't recognize that command line syntax.
The "right" one has traditionally been:
https://support.micr...en-us/kb/947024

oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\winpe_x64\etfsboot.com#pEF,e,bc:\winpe_x64\efisys.bin c:\winpe_x64\ISO c:\winpe_x64\winpeuefi.iso

Or, using a particular recent version of mkisofs:
http://reboot.pro/to...e-2#entry189483
 

mkisofs.exe -iso-level 4 -l -R -J -joliet-long -D -volid "WINRE" -b boot/etfsboot.com -no-emul-boot -boot-load-size 8 -hide boot.catalog -eltorito-alt-boot -eltorito-platform efi -no-emul-
boot -b efi/microsoft/boot/efisys.bin -o x64\winre.iso x64\iso

http://reboot.pro/to...ickpe/?p=189490

 

:duff:

Wonko



#27 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 13 July 2016 - 07:21 PM

I have a USB drive, formatted with FAT32, bootmgr, copied boot and efi folders. Tested it and boots fine in BIOS and UEFI.

  
Adjust this USB drive.

Change boot.wim:
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Cmdline is processed at boot.
Adjust the setting and call your batch.

#28 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 14 July 2016 - 07:05 AM

  
Adjust this USB drive.

Change boot.wim:
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Cmdline is processed at boot.
Adjust the setting and call your batch.

Nice idea! :)

 

Just in case:
https://social.techn...forum=itproxpsp

 

:duff:

Wonko



#29 Uneitohr

Uneitohr

    Frequent Member

  • Advanced user
  • 219 posts

Posted 14 July 2016 - 09:36 AM

Thanks Wonko. The oscdimg worked fine.

 

Here is the full script:

 

startnet.cmd

wpeinit
cmd /c %~d0\00_Config\diskpart.cmd

diskpart.cmd

@echo off
setlocal enableextensions disabledelayedexpansion


call :showDiskTable
set /p "diskNumber=Type number of disk to format: " || goto :processCancelled

SET strterm=___ENDOFSTRING___
SET tmp=%diskNumber%%strterm%
:loop
SET item=%tmp:~0,1%
SET tmp=%tmp:~1%


(   echo select disk %item%
    echo list disk
) | diskpart

set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
    echo SELECT DISK %item%
    echo CLEAN
    echo CREATE PARTITION PRIMARY
    echo FORMAT QUICK FS=NTFS
    echo ACTIVE
    echo ASSIGN LETTER="C"
)


diskpart /s "%scriptFile%"
del /q "%scriptFile%"


IF NOT "%tmp%" == "%strterm%" GOTO loop
exit /b 0




:showDiskTable
echo =====================================================
echo list disk | diskpart
echo =====================================================
echo(
goto :eof


:processCancelled
echo(
echo PROCESS CANCELLED
echo(
exit /b 1

Now, onto your other suggestions. Why would I use HKEY_LOCAL_MACHINE\SYSTEM\Setup\Cmdline instead of startnet.cmd?



#30 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 14 July 2016 - 12:48 PM

I don't know. :dubbio:

That script has little to do with "wipe", and a lot about "wipe and make a senselessly huge single primary NTFS partition AND format it AND assign to it letter C:".

 

It is interesting how useful has been the warning in this post:

http://reboot.pro/to...as/#entry199510

 

And the batch is (obviously) a badly made copy and paste/merge from:
http://stackoverflow...or-disk-or-quit

https://stackoverflo...le-string-batch

 

with some error control removed :w00t: :ph34r:

 

If you went as far as finding the way to avoid a temporary diskpart script file:

(   echo select disk %item%
    echo list disk
) | diskpart

I wonder why just after it you went back to the script file :unsure::

set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
    echo SELECT DISK %item%
    echo CLEAN
    echo CREATE PARTITION PRIMARY
    echo FORMAT QUICK FS=NTFS
    echo ACTIVE
    echo ASSIGN LETTER="C"
)


diskpart /s "%scriptFile%"
del /q "%scriptFile%"

The list disk command - however - needs not a select disk before.

 

Personally it sounds to me like some:

https://en.wikipedia...kboard_scraping

but anyway, if it works for you, and for what you want to have the .cmd do, it's fine :).

 

:duff:

Wonko



#31 Uneitohr

Uneitohr

    Frequent Member

  • Advanced user
  • 219 posts

Posted 14 July 2016 - 12:59 PM

Sorry if it is not your linking. 

I was in a rush. 



#32 Uneitohr

Uneitohr

    Frequent Member

  • Advanced user
  • 219 posts

Posted 30 December 2016 - 12:04 AM

I redid the script back in August but forgot to add it.

diskpart.cmd executed using startnet.cmd is as follows:

@echo off

echo list disk | diskpart
echo(

set /p "diskNumber=Type number of disk to format: "


(echo select disk %diskNumber%
echo clean
echo convert mbr
echo create partition primary size=350
echo format quick fs=ntfs label="System Reserved"
echo active
echo create partition primary
echo format quick fs=ntfs
echo exit ) | diskpart.exe

I've been using this to wipe manufacturer disks which come with GPT layout. It works but the problem is that I have to boot a 500MB iso just to execute a 1KB script.

 

What I am looking for now is either wipe/corrupt partition table from within windows. as is described in this thread http://reboot.pro/to...local-system/  or    add a bcd/boot.ini entry that will load something to wipe the drive.

 

Sometimes you cannot use a CD or USB device to perform these actions and must be done automatically.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users