Win10 Setup Disk [For UEFI or BIOS / UEFI with Secure Boot / Install.wim over 4 GB]

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

  1. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    When you mount an unformated usb stick, you have no drive letter at all.
     
  2. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    As explained in a previous post, the script creates two partitions on a usb stick. This is not available with windows 7. And btw the script "mounts" an iso file : afaik this is only possible starting with windows 8. Why complicate your life? install.wim for windows 7 should not exceed 4 Gbytes. Just format your usb stick as fat32 and copy your W7 files to it. Make sure the fat32 partition is marked active when booting on a legacy mbr system; no need for rufus.
     
  3. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
    Is there a problem with the present script?

    Code:
    Foreach ($USBDisk in $Disks) {
        $FriendlyName=($USBDisk.FriendlyName).PadRight(40," ").substring(0,39)
        $USBDisks+=$USBDisk.DiskNumber
        $USBDiskList.Items.Add(("{0,-39}{1:n2} GB" -f $FriendlyName,($USBDisk.Size/1GB)))|out-null
        $Partitions = Get-Partition | Where-Object { $_.DiskNumber -eq $USBDisk.DiskNumber}
        If ($Partitions) {
            Foreach ($Partition in $Partitions) {
            $Volumes=get-volume | Where-Object {$Partition.AccessPaths -contains  $_.path }
                Foreach ($Volume in $Volumes) {
                    $USBDisks+=$USBDisk.DiskNumber
                    $USBDiskList.Items.Add(("{0,-2}({1,1}:){2,-31}[{3:n2} GB]" -f " ", ($Partition.DriveLetter), $Volume.FileSystemLabel.PadRight(25," ").substring(0,25), ($Partition.Size/1GB)))|out-null
                }
            }
        }
    }
     
  4. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    No problem at all.
     
  5. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    You don't need to replace it, i'm not sectariant; the output is not better : it's only a matter of taste!
     
  6. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
  7. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    Yes, I know...

     
  8. uffbros

    uffbros MDL Senior Member

    Aug 9, 2010
    377
    31
    10
    @freddie-o ...Your download link says 404 not found if you want to fix it. Thanks. Love this script.
     
  9. coleoptere2007

    coleoptere2007 MDL Guru

    Apr 8, 2008
    3,136
    1,735
    120
  10. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
  11. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    129
    22
    10
    Is it better to use this script to create a Windows 10 Installation disk than other tools like Rufus?
     
  12. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
    #255 freddie-o, Oct 19, 2019
    Last edited: Oct 19, 2019
    (OP)
    The only advantage I know of with this script is, if your PC is on UEFI with Secure Boot, you don't need to temporarily disable Secure boot during installation.

    But
     
  13. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
    #256 freddie-o, Oct 19, 2019
    Last edited: Oct 19, 2019
    (OP)
    Personally, I use Win10XPE. Because I can do more in a WinPE environment. Install Windows, create and restore backup Images of my OSes, Disk partitioning/management, etc.

    I don't even use a USB disk to boot into WinPE. I just boot from a separate partition in my harddisk and use EasyBCD to add the boot.wim to the BCD store.
     
  14. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    Yes, booting boot from a separate partition in your harddisk is a good idea because booting from a usb stick requires that you enter the boot menu and takes time. Do you just copy the content of the iso image? Or just the content of the sources directory?
     
  15. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    682
    762
    30
    I first make a backup of my EFI System Partition with EasyUEFI so I can restore it back afterwards. When I boot into WinXPE to do other tasks aside from installing Windows.
     
  16. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,144
    957
    60
    I copyed boot.win in a new partition, booted into it but after some screen got an error concerning missing drivers. Searched other solutions :
    Boot in the recovery partition; this was ok.
    Create a new partition or use a vhd and applying the boot.wim image; this was ok.
    On my system i installed macrium reflect; after booting ou can open a cmd session and install windows.