Create media for automated unattended install of Windows 10  

Page 60 of 99 FirstFirst ... 1050585960616270 ... LastLast

  1. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #590

    Excellent work!
      My Computers


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #591

    Well, because I'm being really picky, and also as a learning exercise, I've taken this to the next level...

    I already have a program I wrote to manage nearly every aspect of Windows Image Management for me. I now added the ability to add and remove files from the WinPE image.

    By dropping the batch file that partitions the HD into the WinPE image, we eliminate any guessing games as to the drive letter. Windows PE always gets installed to a RAM Drive with the designation of X:. As a result, you can simply specify X: as the drive letter where your batch file is located.

    Tested and it works like a charm. Now it is a truly completely unattended installation that does the partitioning properly according to Microsoft's latest recommendations.

    If anyone wants the step by step instructions to accomplish this just let me know. It will take a little while to write-up, but here is a high level overview:

    Copy the Windows distribution to HD.
    Mount the boot.wim (located in the \sources folder).
    Add or remove files from the mount location (in this case, the script for partitioning the HD).
    Commit the changes and unmount the image.
    Create your answer file and drop it into the root of the Windows distribution on the HD.
    Create a new ISO image or physical media from the distribution on the HD.
    Boot from the media for a 100% fully unattended installation.
      My Computers


  3. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #592

    Yes, very much so - I'm looking for a way to do all of this perfectly - as clean installs using Windows 10 default media set up the partitions correctly, and I was hoping that this tutorial would allow me to have the partitions in the correct (read: desired) order as well as a (simple) customized, autounattended install - but with all of the discussion here, I gathered that the autounattended install requires that partitions to be manually created.

    Unless I'm missing something.

    Out of curiosity, how do you get the file copied to the X: RAMDRIVE that is set up for installing Windows?
      My Computers


  4. Posts : 4,187
    Windows 11 Pro, 22H2
       #593

    johngalt said:
    Yes, very much so - I'm looking for a way to do all of this perfectly - as clean installs using Windows 10 default media set up the partitions correctly, and I was hoping that this tutorial would allow me to have the partitions in the correct (read: desired) order as well as a (simple) customized, autounattended install - but with all of the discussion here, I gathered that the autounattended install requires that partitions to be manually created.

    Unless I'm missing something.

    Out of curiosity, how do you get the file copied to the X: RAMDRIVE that is set up for installing Windows?
    Okay, I'll write it up. Be patient with me. May take me a little while

    To get files onto the RAM Drive, you simply drop the files into the Windows PE image (boot.wim). When you boot from the install media, one of the first things that setup does is to create the RAM Drive and copy all the files from that Win PE image to the RAM Drive.

    I'm just having way too much fun for my own good with all this stuff
      My Computers


  5. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #594

    Oh, ffs. I should have known that - build them into the PE image. LMFAO.

    I'm sorry, been a long day and I wasn't thinking.

    I'm going to run through the tutorial to see if I can get a good image built, using the bat files and various sundry other things to get it all installed.
      My Computers


  6. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #595

    OK, another question - but I have to ask.

    If we build this autounattended file and the unattend file, and leave out anything about the partitioning, won't Windows go with the default partitions and set them up the way it wants to?

    If so, then I can skip that section of the tutorial to accomplish what I need.

    Background: I'm working at a non-profit, and teaching IT Certification prep classes (not cram classes - longer more in-depth classes). But we also do on-site testing for PearsonVUE (which administers CompTIA cert tests, among a *large* range of other tests). We currently have 4 machines that are set up for this, but they were hastily pulled and set up before I came there and have 1) A lot of junk on them that we do not need, and 2) we're adding 4 more machines with the same junk. My idea here is to make the custom unattended install through this tutorial, using absolute basics for info - company name, locale, etc. already put there, but I have no need for modifying the parts from default (450/16/bulk/500 (or larger, as the case may be, maybe 650 as suggested in the Micro$oft script).

    But if I leave out the partitioning section completely from the answer file, will Windows just make 1 gigantic partition? Or will it default to what it thinks it needs in terms of the System, EFI, Windows and MSR partitions?

    I'm *guessing* that in using a custom answer file I'm forced to set the partitions manually in there. But if I don't need to, I'm gonna skip it and try - because it's 1 less headache and it will, by default, be set up correctly.

    The machines are all HP Compaq 6200 MicroTowers or 6300s, all from around 2012 (Core i3/5 2xxx CPUs), and HP has 0 updates for any of them since 2014, and they were purchased from a MAR (M$ Authorized Refurbisher) with a COA Win 10 for Refurb PC only key (each has its own, so not an enterprise single key or anything like that). I've manually performed one install on one of the 4 new machines, using diskpart to simply just 'clean' and 'convert gpt' the HDD in the system (All are 1 TB Mechanical drives) and it had no issue sin terms of needed any specialized drivers, but being able to customize the install, and particularly removing some of the crap that gets installed that has no need to be installed, would be beneficial, making my life much easier, particularly since the machines are already in the testing area, so me being in there doing stuff while others are taking tests is not a good idea.
      My Computers


  7. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #596

    Also, I have another question. Can this method be used to remove programs installed by default, particularly UWP apps, that I know for a fact will never be used?

    I know that in the past, if I have tried to remove apps via Audit Mode, and I realize there is probably a better way to do it, such as a Deployment using the MDT or some other tool, but I'm asking only for this particular tutorial directly.

    In addition, I used a rather neat trick to get the files into the VM without having to log into Drive - I simply create an \Assets folder, copied the 3 files into there, then used ISORecorder to make an .ISO of the folder - which I then mounted in the VM to copy the logo, unattend.xml, and the RunOnce.bat - and verified that they did not have Read Only attributes also. Just another way to do it via the VMs
      My Computers


  8. Posts : 4,187
    Windows 11 Pro, 22H2
       #597

    To add files to the WinPE image (boot.wim)

    You will need to have these items:

    Windows 10 ISO image or physical media.
    Windows ADK needs to be installed. Only the Deployment Tools option needs to be installed.

    Copy the contents of your Windows 10 media to the HD. In my example, I'm going to assume that I am using Windows 10 x64 media and that I'm copying the files to D:\ISO_Files.

    Create a folder to which you can mount the boot.wim. I'll use the directory named D:\WinPE.

    Go to Start > Windows Kits. Right-click on Deployment and Imaging Tools Environment, choose More > Open as Administrator.

    The command prompt will probably open with a long path. Type in "CD " to go back to the root. This simply makes easier to view.

    Run the following command to mount the boot.wim file to the D:\WinPE folder:

    Code:
    dism /mount-image /imagefile:D:\ISO_Files\Sources\boot.wim /index:2 /mountdir:D:\WinPE
    NOTE: The boot.wim file has 2 indices. We only need to mount and update index #2 which is why we use "index:2" in the above command.

    Once mounted, copy your script or any other files you need to D:\WinPE. For the sake of this example, assume that you are copying the batch file for partitioning the HD and the text file with the diskpart commands that this script uses. NOTE: It's possible to create the batch file so that no additional text file is needed, but that's a topic for another time.

    Perform a cleanup using this command:

    Code:
    DISM /Cleanup-Image /Image:D:\WinPE /StartComponentCleanup
    Finally, unmount the image:

    Code:
    Dism /Unmount-Image /MountDir:D:\WinPE /Commit
    The boot.wim image located in D:\ISO_Files is now updated.

    Copy your autounattend.xml answer file to D:\ISO_Files.

    NOTE: You can remove the sections that deal with partitioning the HD (Windows-Setup\DiskConfiguration). Make sure that you configure Windows-Setup\ImageInstall\OSImage\InstallTo\PartitionID to partition #3.

    Add either Windows-Setup\RunAsynchronous\RunAsynchronousCommand or Windows-Setup\RunSynchronous\RunSynchronousCommand to Pass 1 windowsPE. Set the "Order field" to "1" and the "Path" field to the full path the batch file. This will be on the root of the X: drive. Example: X:\MyScript.bat.

    Recreate an ISO image or physical media using the files located in the D:\ISO_Files folder. If you need instructions on how to accomplish this, let me know.

    Here is a sample answer file with the following attributes:

    IMPORTANT: This answer file is configured to do a complete unattended install of a clean copy of Windows (not a syspreped image which would also use a second answer file named unattend.xml). If you need more info about this let me know.
    It is made for a UEFI based x64 installation of Win 10 Pro.
    All language settings are for the United States / English.
    Timezone is set to US/Central time.
    It creates an admin level user called "WinUser" ("Windows User" for the full name), with no password.
    This answer file also features a one-time autologon so that setup is 100% completed automatically without you having to even logon the first time.


    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SetupUILanguage>
                    <UILanguage>en-US</UILanguage>
                </SetupUILanguage>
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>3</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
                <UserData>
                    <ProductKey>
                        <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                </UserData>
                <RunAsynchronous>
                    <RunAsynchronousCommand wcm:action="add">
                        <Order>1</Order>
                        <Path>X:\CreatePartitions-UEFI.bat</Path>
                    </RunAsynchronousCommand>
                </RunAsynchronous>
            </component>
        </settings>
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                    <ProtectYourPC>1</ProtectYourPC>
                    <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
                </OOBE>
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <Password>
                                <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                                <PlainText>false</PlainText>
                            </Password>
                            <DisplayName>Windows User</DisplayName>
                            <Group>Administrators</Group>
                            <Name>WinUser</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
                <TimeZone>Central Standard Time</TimeZone>
                <AutoLogon>
                    <Password>
                        <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                        <PlainText>false</PlainText>
                    </Password>
                    <Enabled>true</Enabled>
                    <LogonCount>1</LogonCount>
                    <Username>WinUser</Username>
                </AutoLogon>
                <FirstLogonCommands>
                    <SynchronousCommand wcm:action="add">
                        <CommandLine>reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon&quot; /v AutoLogonCount /t REG_DWORD /d 0 /f</CommandLine>
                        <Order>1</Order>
                    </SynchronousCommand>
                </FirstLogonCommands>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Logo>C:\Windows\System32\oemlogo.bmp</Logo>
                </OEMInformation>
                <TimeZone>Central Standard Time</TimeZone>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:c:/iso_files/x64/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
      My Computers


  9. Posts : 4,187
    Windows 11 Pro, 22H2
       #598

    Some answers to specific questions:

    If we build this autounattended file and the unattend file, and leave out anything about the partitioning, won't Windows go with the default partitions and set them up the way it wants to?

    No - setup will make no assumptions. If you tell Windows to install to partition 3 on disk 0, that's where it will install. It will expect it to be there since the answer file is not set partition the drive (the batch file will do that for us).

    But if I leave out the partitioning section completely from the answer file, will Windows just make 1 gigantic partition? Or will it default to what it thinks it needs in terms of the System, EFI, Windows and MSR partitions?

    There are no defaults - if you don't tell it what to do, it won't do it.

    Can this method be used to remove programs installed by default, particularly UWP apps, that I know for a fact will never be used?

    I'm not aware of a way to do this, but I must admit that I've not ever tried to do this. May need to research this more.
      My Computers


  10. Posts : 4,187
    Windows 11 Pro, 22H2
       #599

    johngalt said:
    In addition, I used a rather neat trick to get the files into the VM without having to log into Drive - I simply create an \Assets folder, copied the 3 files into there, then used ISORecorder to make an .ISO of the folder - which I then mounted in the VM to copy the logo, unattend.xml, and the RunOnce.bat - and verified that they did not have Read Only attributes also. Just another way to do it via the VMs
    Quick question: What hypervisor do you use? I use your method for Hyper-V, but if you use VMware Workstation, it's even easier. Simply install the VMware tools and then you can simply drag and drop files right onto the VM.
      My Computers


 

Tutorial Categories

Create media for automated unattended install of Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:49.
Find Us




Windows 10 Forums