How to create Windows.old when doing unattended install?

Page 1 of 2 12 LastLast

  1. Posts : 4
    Windows 10
       #1

    How to create Windows.old when doing unattended install?


    I have an unattended USB setup perfectly, but as per the guides on win10guru it sets WillWipeDisk to true.

    I know in manual installs, if the partition has the correct format, it will tell me that a previous windows was detected and is being moved to windows.old.

    I would like to do an unattended install that keeps the previous data in windows.old folder.

    I am typically doing these installs on customers laptops that need fixing, so it's very likely that their will be multiple partitions for vendor specific drivers or recovery. Will this be a problem?

    Thanks.
      My Computer


  2. Posts : 41,473
    windows 10 professional version 1607 build 14393.969 64 bit
       #2
      My Computer


  3. Posts : 4
    Windows 10
    Thread Starter
       #3

    This is for manual install. I am asking about unattended install.
      My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #4

    MQInstall said:
    I would like to do an unattended install that keeps the previous data in windows.old folder.
    Then solution is simple: just remove the partitioning part, everything in <DiskConfiguration> tags from autounattend.xml answer file.

    Below is the sample answer file from this tutorial, step 3.22: Create media for automated unattended install of Windows 10

    I've highlighted the part that needs to be removed:

    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-GB</UILanguage>
                </SetupUILanguage>
                <InputLocale>040b:0000040b</InputLocale>
                <SystemLocale>en-GB</SystemLocale>
                <UILanguage>en-GB</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-GB</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">
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>450</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Extend>true</Extend>
                                <Order>4</Order>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>3</Order>
                                <Size>16</Size>
                                <Type>MSR</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Size>100</Size>
                                <Type>EFI</Type>
                            </CreatePartition>
                        </CreatePartitions>
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Format>NTFS</Format>
                                <Label>WinRE</Label>
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Format>FAT32</Format>
                                <Label>System</Label>
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Format>NTFS</Format>
                                <Label>Windows</Label>
                                <Letter>C</Letter>
                                <Order>4</Order>
                                <PartitionID>4</PartitionID>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Order>3</Order>
                                <PartitionID>3</PartitionID>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                </DiskConfiguration>
                <UserData>
                    <ProductKey>
                        <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                    <Organization>Ten Forums</Organization>
                </UserData>
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>4</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="catalog://agm-w10pro02/hyper-v/iso_files/sources/install_windows 10 pro.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>

    Resulting answer file looks like this:

    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-GB</UILanguage>
                </SetupUILanguage>
                <InputLocale>040b:0000040b</InputLocale>
                <SystemLocale>en-GB</SystemLocale>
                <UILanguage>en-GB</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-GB</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">
                <UserData>
                    <ProductKey>
                        <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                    <Organization>Ten Forums</Organization>
                </UserData>
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>4</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="catalog://agm-w10pro02/hyper-v/iso_files/sources/install_windows 10 pro.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>

    An extremely important part of this simplified answer file is to use correct disk and partition ID, both according to previous Windows installation. Both values are found within <InstallTo> tags:

    Code:
               <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>4</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>

    DiskID is usually 0, primary disk, but for instance in modern laptops with a large HDD and smaller SSD (like my HP ProBook 470 G5), Windows is in most cases installed on SSD which often is the secondary disk, DiskID 1.

    The PartitionID can be 1, 2, 3 or 4. depending on how and when previous Windows installation was made. It must match the PartitionID of the Windows partition in previous, existing Windows installation:
    • PartitionID 1: legacy BIOS / MBR setup without System Reserved partition
    • PartitionID 2: legacy BIOS / MBR setup with System Reserved partition
    • PartitionID 3: UEFI / GPT setup, old default partitioning in W10 v. 1909 and earlier (EFI, MSR, WinRE, Windows)
    • PartitionID 4: UEFI / GPT setup, new default partitioning in W10 v. 2004 and later (EFI, MSR, Windows, WinRE)

    That's it. Disk will not be wiped, and user data from previous installation will be moved to Windows.old folder.

    Kari
    Last edited by Kari; 14 Sep 2020 at 13:56. Reason: Fixed some typos.
      My Computer


  5. Posts : 4
    Windows 10
    Thread Starter
       #5

    I was waiting for your reply, the unattended install legend himself :)

    If my boot device (USB) is NTFS UEFI, can I still install to an MBR partition without issue? If not, will running mbr2gpt.exe through synchronouscommand in the windowsPE pass allow me to?

    Do you think this is a good way to keep user data, I've heard one can use task sequences but it seems much more complicated compared to an answer file.
      My Computer


  6. Posts : 17,661
    Windows 10 Pro
       #6

    MQInstall said:
    If my boot device (USB) is NTFS UEFI, can I still install to an MBR partition without issue? If not, will running mbr2gpt.exe through synchronouscommand in the windowsPE pass allow me to?
    Partitioning mode (MBR or GPT) of the install media has nothing to do with partitioning of the Windows system disk. In whatever your install media is created, whatever partitioning it uses, can be used to install Windows on any MBR or GPT partitioned hard disk.

    Kari
      My Computer


  7. Posts : 4
    Windows 10
    Thread Starter
       #7

    Kari said:
    Partitioning mode (MBR or GPT) of the install media has nothing to do with partitioning of the Windows system disk. In whatever your install media is created, whatever partitioning it uses, can be used to install Windows on any MBR or GPT partitioned hard disk.

    Kari
    So if the hard disk is MBR, I would have to change the unattend file to do MBR install (in the disk configuration part)
      My Computer


  8. Posts : 14,020
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #8

    MQInstall said:
    So if the hard disk is MBR, I would have to change the unattend file to do MBR install (in the disk configuration part)
    It's my experience a reinstall or Upgrade install process creates the windows.old folder as needed. BUT, if having data one doesn't want to lose or that exists nowhere else it'd be best to have it copied elsewhere and I wouldn't trust the Cloud.
      My Computers


  9. Posts : 17,661
    Windows 10 Pro
       #9

    MQInstall said:
    So if the hard disk is MBR, I would have to change the unattend file to do MBR install (in the disk configuration part)
    If you want to keep your data, as your original post implies, the autounattend.xml file for Windows Setup as shown in my previous post is exactly the same, because actually no partitioning is required.


    Berton said:
    I wouldn't trust the Cloud.
    It's not often that I completely, totally, profoundly disagree with you. I would not survive without cloud, in my case OneDrive and SharePoint.

    Everything I need is always on cloud. I even exclude OneDrive folders on my devices from my daily incremental backups, because I don't have to think about losing the data. Microsoft's OneDrive is the most safe and secure place to store your important data.

    Kari
      My Computer


  10. Posts : 14,020
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #10

    Kari said:
    If you want to keep your data, as your original post implies, the autounattend.xml file for Windows Setup as shown in my previous post is exactly the same, because actually no partitioning is required.




    It's not often that I completely, totally, profoundly disagree with you. I would not survive without cloud, in my case OneDrive and SharePoint.

    Everything I need is always on cloud. I even exclude OneDrive folders on my devices from my daily incremental backups, because I don't have to think about losing the data. Microsoft's OneDrive is the most safe and secure place to store your important data.

    Kari
    That's okay, why "I" was mentioned.
      My Computers


 

  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 02:54.
Find Us




Windows 10 Forums