Win10+ Setup Disk (Works with UEFI Secure Boot / BIOS / Install.wim over 4 GB)

Discussion in 'Scripting' started by freddie-o, Mar 21, 2019.

  1. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,440
    1,420
    60
    replace $newsize.height = 3000 by $newsize.height = [Math]::Min^(50, $pshost.ui.rawui.MaxWindowSize.height^)
    and
    $newsize.height = 50 by $newsize.width = [Math]::Min^(150, $pshost.ui.rawui.MaxWindowSize.Width^)
    (lines 17-18)
    The problem with https://forums.mydigitallife.net/th...bios-install-wim-over-4gb.79268/#post-1513554 occurs when you have many usb sticks with the same characteristics mounted. How do you choose the correct one?
     
  2. freddie-o

    freddie-o MDL Expert

    Jul 29, 2009
    1,358
    2,267
    60
    Normally when creating a boot disk it's less confusing and less likely to make a mistake to just have one usb stick plugged in. Anyway not a big deal.
     
  3. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,440
    1,420
    60
  4. freddie-o

    freddie-o MDL Expert

    Jul 29, 2009
    1,358
    2,267
    60
    #25 freddie-o, Apr 6, 2019
    Last edited: Apr 6, 2019
    (OP)
  5. Windows_Addict

    Windows_Addict MDL Expert

    Jul 19, 2018
    1,245
    3,407
    60
    Executionpolicy bypass cmd didn't work correctly. (Win 10 1809 x86)
    This worked.
    Code:
    powershell -noprofile -executionpolicy bypass -WindowStyle Normal -file "%temp%\script.ps1"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. uffbros

    uffbros MDL Senior Member

    Aug 9, 2010
    447
    58
    10
    #31 uffbros, Jun 9, 2019
    Last edited: Jun 9, 2019
    Here is a dumb question. I downloaded the script. I run as admin..It flashes and goes away?? How do you work this then? I ran it from C drive..I ran it from the USB drive???? I tried putting script in same folder as the extracted .iso of Win 10...I put it in the .iso folder....I give up??
     
  7. jrmpt

    jrmpt MDL Novice

    Jan 21, 2019
    4
    0
    0
    Hi, used rpo's 'Create USB Boot Device' script to create a UEFI/MBR USB windows 10 installer. Tested with an old MBR and all went good. When I use it to boot on the machine with UEFI, it shows 3 options to boot:

    1) USB GENERIC DRIVE (MBR. The only that shows on the old machine with BIOS)
    2) UEFI: FAT
    3) UEFI: NTFS

    Which one (2 or 3) should I pick?

    Thanks.
     
  8. uffbros

    uffbros MDL Senior Member

    Aug 9, 2010
    447
    58
    10
    #33 uffbros, Jun 9, 2019
    Last edited: Jun 9, 2019
    How do you create the boot drive from that file? I click it and it just does a quick flash and disappears?
    RPO's does the same thing....window flashes and goes away...Thats all it does?????
     
  9. jrmpt

    jrmpt MDL Novice

    Jan 21, 2019
    4
    0
    0
    Hi. Run with administrator privileges. Right-click on Create USB Boot Device.cmd and click 'run as administrator'
     
  10. uffbros

    uffbros MDL Senior Member

    Aug 9, 2010
    447
    58
    10
    I did....Already said that...nothing happens....A black window opens up and then disappears instantly. Yes I disabled antivirus and antimalware programs?????
     
  11. freddie-o

    freddie-o MDL Expert

    Jul 29, 2009
    1,358
    2,267
    60
    This is unusual... it should just boot directly with no options. :confused:
     
  12. uffbros

    uffbros MDL Senior Member

    Aug 9, 2010
    447
    58
    10
    Can you explain how your doing it? Do you put this script in same folder as extracted .iso of Windows? Or do you put it in same folder as the .iso? What are the steps? Does the files have to be on C drive or can it be run from anywhere?
     
  13. Jack Schitt

    Jack Schitt MDL Novice

    Nov 26, 2010
    35
    20
    0
    #39 Jack Schitt, Jun 9, 2019
    Last edited: Jun 9, 2019
    Had similar issues here. I ran the script (renamed to WBD.cmd) from an elevated command prompt so the window would stay open for me to read the error. Mine was due to PowerShell execution policies on this computer:
    Code:
    C:\Utils>WBD.cmd
    C:\temp\script.ps1 : File C:\temp\script.ps1 cannot be loaded because running scripts is disabled
    on this system. For more information, see about_Execution_Policies at
    https:/go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + C:\temp\script.ps1 -ExecutionPolicy Bypass -WindowStyle Normal
    + ~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess
    
    
    Following the link (from above), I used the PS command "Get-ExecutionPolicy -List" and found the "CurrentUser" was restricted.
    Remedied with the PS command: "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser"

    All good now.
    WBD.png
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. freddie-o

    freddie-o MDL Expert

    Jul 29, 2009
    1,358
    2,267
    60
    It should run from anywhere.