Administrators Trevor Neale 0 Posted November 6 Administrators Share Posted November 6 During Windows installation, Sysprep may occasionally fail if your computer is connected to a network. To prevent this issue, itβs best to install Windows without any active network connection. Only connect your device to the internet after entering Audit Mode, as described in the steps below. When installation reaches the Region Selection screen after reboot press CTRL + SHIFT + F3: Windows reboots now entering a so called Audit Mode using the built-in administrator account. When Windows Desktop will be shown you'll notice the System Preparation Tool dialog in the middle of your screen. Close it for now by pressing the Cancel button: 2. Create an unattended answer file If you installed Windows without a network connection, you can connect to network now. The relocation procedure itself will be done with a native Windows 10 tool called System Preparation Tool (Sysprep). Sysprep alone can quite little, it needs instructions. These instructions it gets from an XML script file, an unattended answer file. In our case we need a very simple answer file. It simply contains two important details, instructions to Sysprep: Bit version of the Windows (32 or 64 bit) New location of Users folder (for example D:\Users instead of default C:\Users) OK, let's start. Open Notepad, paste the following code to a new file: Code: <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="oobeSystem"> <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"> <FolderLocations> <ProfilesDirectory>D:\Users</ProfilesDirectory> </FolderLocations> </component> </settings> </unattend> Change the following details if needed (see the parts in red in above code): Line 4: The value of variable ProcessorArchitecture must be amd64 if you are installing a 64 bit Windows regardless of if you have an Intel or AMD processor, and x86 if you are installing a 32 bit Windows Line 6: The value in ProfilesDirectory tags is the new location for the Users folder, in this example answer file it will be moved to D:\Users.Be sure that the drive into which you are relocating the Users folder is empty or at least does not contain any Windows system folders, especially Users folder or parts of it from any current or previous Windows installation."[/ Please read this before proceeding! Windows "likes" to set the the drive ID letters like this: Drive C: > The system drive where Windows will be installed Drive D: > First optical drive (CD / DVD drive) Drive E: > Second partition on the same disk where the C: is located, or in case that disk only has one partition, the first partition on the secondary disk Now when you sysprep telling it to move the Users to a specific drive, after the reboot Windows might find that intended target drive for Users folder has another drive ID letter and your intended drive D: is now E:. Sysprep fails and you have to reinstall. To be sure you are able to use your chosen partition for the relocated Users folder you need to set the drive letters manually before the sysprep is run. In Audit Mode you can do this for instance with Disk Management by manually changing the drive letters. In below example I want to secure that Users folder will be moved to D drive: Change the optical drive letter to something at the end of the alphabet, I use W: Change the drive letter of the partition or disk you intend to use for the Users folder to D: If the partition or disk you want to use already has a letter D:, change it to something else, close the Disk Management, open it again and change the letter back to D: See the tutorial at our sister site the Seven Forums: Drive Letter - Add, Change, or Remove in Windows - Windows 7 Help Forums I recommend to always set drive letters manually to override the defaults. Save the file as an XML file to root of any drive except C:. In this example I have already renamed my π§ drive to User Profiles and save the answer file there as D:\relocate.xml: 3. Run Sysprep Almost there! Open elevated Command Prompt (tutorial). To ensure that WMP Network Sharing Service is stopped, give the following command: net stop wmpnetworksvc The service is most probably not running but if it is, it will now be stopped. When this service is running, Sysprep fails. Now the Sysprep command itself. Type the following: %windir%\system32\sysprep\sysprep.exe /oobe /reboot /unattend:d:\relocate.xml The above command tells system to run the Sysprep from Windows\System32\Sysprep folder reading instructions from the unattended answer file D:\relocate.xml, prepare the computer for an OOBE boot (OOBE = the first boot of newly installed Windows) and finally reboot when ready. Hit Enter, you will see Sysprep starting to do its magic: That's it. Windows runs now the OOBE First Run boot and you can continue from the installation tutorial step 12 where we left the installation in the beginning of this tutorial. When finally at Windows Desktop, you will notice that the main profile folder and your user account in it have been moved to drive π§ (or any other drive you selected): Relocating Users folder on an existing Windows installation Warning Do not proceed before creating a system image! Sysprepping an existing installation with an OEM pre-installed Windows is risky. Manufacturers might have their own unattended answer files in place which ignore your custom unattended files. Anything can go wrong when sysprepping an existing installation, I do not recommend doing this. If you decide to try it and it fails and you post about it, I will remind you about this warning asking you to restore the system image you made before proceeding. Short: Relocating Users folder with Sysprep should only be done on new, clean installs! Trying this Method Two, relocating Users on an existing installation might force you to do a complete reinstall or restore your PC to factory state. A video about Method Two: Note Β Note With Windows 10 version 1703 and later you do not have to disable existing users as shown in video! In fact, in doing so might even lock you completely out from Windows, forcing you to do a reinstall. Version 1703 (build 15063 and later), do not disable / deactivate existing user accounts as hown in video! 1. Create an unattended answer file Create an answer file exactly as told above in Method One Step 2. 2. Run Sysprep Run Sysprep exactly as told above in Method One Step 3. 3. OOBE Boot Although you already had Windows 10 installed, after Sysprep the first run OOBE boot is always run. This means that Windows goes through the initial setup process. You continue now from step 12 in installation tutorial. Two things to notice now: You don't have to enter the product key now even Windows will ask it. Entering it does no harm but if you want to save some key presses, you can simply click Skip button: Your original user accounts have not disappeared, everything is still there. However, the OOBE boot requires a user account to be created but if you try your existing account, local or Microsoft account, you get an error message: To work around this, simply set up a dummy local account (see installation tutorial step 19). You can then later log in to your original account and remove this dummy local account. Upgrade and Sysprep: what to do when upgrading from Windows 7, 8 or 8.1 See 1. Move ProgramData back to π drive below for how to prepare Windows for an upgrade by moving the ProgramData folder back to π drive if you have relocated it to another drive. See 2. Edit Registry to Sysprep an Upgraded Windows below for how to run Sysprep on an upgraded Windows. Note Β Note Please notice that with the Build 10586 (TH2 version 1511) and later there has been no issues in upgrading even with relocated Users folder. If upgrading from Windows 7 with not only the Users folder but also the ProgramData folder relocated, you have to move ProgramData back to π drive before upgrading as told below. Windows 10 does not support relocating Programdata, nor can you upgrade with relocated ProgramData. This is not necessary if the ProgramData folder is not relocated. Don't panic, this is quite easy :). 1. Move Users (and possible ProgramData) back to π drive Open Notepad, paste the following code to a new file: Code: <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="oobeSystem"> <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"> <FolderLocations> <ProgramData>C:\ProgramData</ProgramData> </FolderLocations> </component> </settings> </unattend> Change the following detail if needed (see the part in red in above code): The value of variable ProcessorArchitecture must be amd64 if you are installing a 64 bit Windows regardless of if you have an Intel or AMD processor, and x86 if you are installing a 32 bit Windows Save the file as an XML file to root of any drive. Now do steps 2 and 3 in Method Two above, continue from below when done. 2. Edit Registry to Sysprep an Upgraded Windows When running Sysprep on an upgraded Windows you might get an error message about Sysprep not being able to validate your Windows installation, Sysprep will simply not run. Checking the log file you will find out the reason in plain text: Code: Sysprep will not run on an upgraded OS. You can only run Sysprep on a custom (clean) install version of Windows. (Log: C:\Windows\System32\Sysprep\Panther\setupact.log) We need to edit Windows registry to "fool" Windows to think this is a clean install instead of an upgrade. To do this open the Registry Editor (WIN + R, type regedit, hit Enter), browse to key HKEY_LOCAL_MACHINE\SYSTEM\Setup Delete both the DWORD Upgrade (right pane) and KEY Upgrade (left pane), see screenshot. The system warns you that skies can fall down if you delete these items, just laugh loud and accept the deletion : Still in Registry Editor, browse to key HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus, if either DWORD CleanupState or DWORD GeneralizationState has any other value than 7, change it to 7 by double clicking the DWORD in question and entering the new value: Close the Registry Editor. Open Command Prompt, type slmgr /dli and hit Enter to open Software License Manager. Close it as soon as it opens, close Command Prompt. You can now upgrade to next build, and when the upgrade is done you can sysprep the upgraded Windows . After the upgrade has finished and you have rebooted back to desktop, repeat this step (registry editing and slmgr /dli as told above), then do the Method Two from above. For Windows 8 and 8.1 users, continue from step 1.2 in the Eight Forums tutorial http://www.eightforums.com/tutorials...tion-disk.html. Note Β Note If you will move the Users back to the same drive where it was earlier before the upgrade, be sure to empty the drive first to a backup location. Drive should be empty before moving the Users from C:, you can after the relocation process then copy your files back to corresponding folders in the new Users folder. That's it folks, have fun with Windows 10! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.