Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Is this the right approach for a truly clean install?

20 Jun 2017   #11
Paul Black

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thanks,

Just to clarify, is this script correct please:

<?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>
<ProgramData>C:\ProgramData</ProgramData>
</FolderLocations>
</component>
</settings>


<cpi: offlineImage cpi:source="wim:X:/sources/install.wim#Windows 7 HOMEPREMIUM" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

What about the two drives in RED, do they need to be changed?

And this script:

net stop wmpnetworksvc
pause
cd c:\Windows\System32\Sysprep
c:\Windows\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:F:\relocate.xml

Thanks.

EDIT:
I assume I can put these two Notepad scripts on a USB and then copy them to the C: drive and run them from there?


My System SpecsSystem Spec
.
20 Jun 2017   #12
Megahertz07

Windows 7 HP 64
 
 

<ProfilesDirectory>D:\Users</ProfilesDirectory>
must be changed to
<ProfilesDirectory>F:\Users</ProfilesDirectory>
as your data drive (\users) will be on F:

The script is OK
My System SpecsSystem Spec
03 Jul 2017   #13
Paul Black

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

I have been away for a while and got back at the weekend.
I tried to setup my laptop yesterday and have problems.

I decided to use D: as the Users/Data partition and I: as the Image partition.
Setting up the partitions went OK after deleting all the partitions except the Disk 0 Partition 1: WINRE.
I copied both the files below into the D: drive and run the Sysprep from the D: drive by double clicking it.
BTW, after setting up the D: and I: partitions the DVD drive went to F:.

Relocate - W7HP.xml 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>
<ProgramData>d:\ProgramData</ProgramData>
</FolderLocations>
</component>
</settings>
<cpifflineImage cpi:source="wim:F:/sources/install.wim#Windows 7 HOMEPREMIUM" xmls:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Sysprep.cmd code:

net stop wmpnetworksvc
pause
cd c:\Windows\System32\Sysprep
c:\Windows\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:D:\Relocate- W7HP.xml

The computer did not reboot automatically, I had to do it manually.

It dropped me back to where it should have done after the cleanup window appeared and I carried on.
When the installation was complete I still had the Users/Profiles etc on the C: drive???
I never got asked for the Product Key either.
The desktop doesn't look right either, it looks like it hasn't finished installing if you know what I mean!

Please help!

Thanks in advance.

EDIT:
The laptop is very slow doing anything. Not as it should be for a clean install.
There are no items in the Startup etc.
In the D: drive there are only the two files posted above.
Th max amount of disk space for system protection is set to zero, I know this should be about 10%.
The screen resolution is also large like when you go into Safe Mode.
Also when I looked at Turn Windows features on or off it caused a system crash followed by a system restart.

I am just going through things that I will want to customize when I manage to get the partitions and user profiles sorted out.
I will obviously be re-installing Windows again because it is certainly not right at the moment.
My System SpecsSystem Spec
.

04 Jul 2017   #14
Paul Black

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Has anyone got any ideas please?
Thanks in advance.
My System SpecsSystem Spec
04 Jul 2017   #15
Megahertz07

Windows 7 HP 64
 
 

Paul,
You can, but I don't recomend to move ProgramData from C: to D:
<ProgramData>C:\ProgramData</ProgramData>

When you launched Sysprep.cmd, was the Relocate - W7HP.xml at D: root (D:/)?
Was the Win 7 installation disk on the ODD drive F: when you launched Sysprep.cmd?
My System SpecsSystem Spec
04 Jul 2017   #16
Paul Black

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thanks for the reply,

When I got to the stage of CTRL + SHIFT + F3 and then cancelling the System Preparation Tool 3.14 information box, I clicked Start>Computer and then double clicked the D: drive. It told me that the drive needed to be formatted which I did using quick format. I then copied the Relocate - W7HP.xml file to the D: root (D:/) drive which is the drive I want all my data and documents to save to.

I also copied the Sysprep.cmd file to the D: root (D:/) drive and double clicked it to launch it.

It appeared that the DVD drive had changed from D: to F:, I assume this is because when I set up the 3 partitions, one for Windows 7 (C:), one for the data and documents (D:) and the other for imaging (E:), that it changed the D: to F:?

Have I got the coding wrong?
Is that why it is not working?

I don't quite understand when you say...
You can, but I don't recomend to move ProgramData from C: to D:
< ProgramData>C:\ProgramData</ProgramData>
...I just want to allocate the user folders to D: to save all my documents and data to so if C: gets corrupted I will not lose my data..

Thanks in advance.
My System SpecsSystem Spec
04 Jul 2017   #17
Megahertz07

Windows 7 HP 64
 
 

You can move:
- C:\users to D:\users with the line <ProfilesDirectory>D:\Users</ProfilesDirectory>
- C:\ProgramData to D:\ProgramData with the line < ProgramData>D:\ProgramData</ProgramData>

C:\ProgramData is a system folder where the program configuration files are stored, so I don't recommend moving to D:
So I would leave ProgramData where it is by default. Set < ProgramData>C:\ProgramData</ProgramData>

You probably didn't do the right sequence. Read Kari tutorial and follow it.
My System SpecsSystem Spec
04 Jul 2017   #18
Kari

 

This is the command you told you used when running Sysprep:

c:\Windows\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:D:\Relocate- W7HP.xml

There seems to a space in your answer file name between the hyphen and letter W. Earlier on that same post you write the same filename with two spaces, both before and after the hyphen.

Both would cause Sysprep to fail. Always (I repeat: always!) when a path contains spaces it must be in quotes, in your case like this:

c:\Windows\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:"D:\Relocate- W7HP.xml"

Even better would of course be to use simple filenames without spaces or special characters. Why don't you just rename the file as relocate.xml?

BTW, there are no issues involved in relocating ProgramData folder, too. Windows 7 fully supports relocating it and Users folder. However, in the future, in case you one of these days decide to upgrade to Windows 10, relocated ProgramData prevents the upgrade. Windows 8 and later do no longer support relocating ProgramData; you can upgrade from 7 to 10 with relocated Users folder, but not if ProgramData is relocated, too.

In addition, I want to quote myself here from the same tutorial on our sister site TenForums.com. It's important to be sure the drive letters remain the same when setup (OOBE) starts after Sysprep. Read the below, ask if it raises any questions:

Quote:
warning   Warning
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.
(Quote from Move Users Folder Location in Windows 10 Windows 10 Installation Upgrade Tutorials )

Kari
My System SpecsSystem Spec
04 Jul 2017   #19
Megahertz07

Windows 7 HP 64
 
 

Paul, it seems that you haven't follow my instructions from post #4.

"Edit Relocate - W7HP.xml.txt and change the ODD drive letter to the one you have set on the previous step. Save it as Relocate.xml and put it on the root of the drive that will have \users (D: or U: )"

What is on Disk 0 Partition 1: WINRE?
Although you can reenter sysprep from a running windows, I'll recommend you to start from the beginning.
Follow my instructions on post #4.
My System SpecsSystem Spec
04 Jul 2017   #20
Paul Black

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thank you both for your replies.

I am just re-installing again and have got further than on previous occasions.
I changed the DVD-ROM drive to X:.
I copied the two files (Relocate.xml & Sysprep.cmd) into the root of D: (after quick formatting) and run the Sysprep.cmd file.

It is giving me the error:

Windows could not parse or process unattend answer file.
[D:\Relocate.xml]. The answer file is invalid. The error was detected at line 11 column 1 of the answer file.

Here is the code I am using for the Relocate.xml file:

<?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>
<ProgramData>C:\ProgramData</ProgramData>
</FolderLocations>
</component>
</settings>
<cpifflineImage cpi:source="wim:X:/sources/install.wim#Windows 7 HOMEPREMIUM" xmls:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Here is the code I am using for the Sysprep.cmd file:

net stop wmpnetworksvc
pause
cd c:\Windows\System32\Sysprep
c:\Windows\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:\Relocate.xml

What is wrong please?

Thanks in advance.
My System SpecsSystem Spec
Reply

 Is this the right approach for a truly clean install?




Thread Tools




Similar help and support threads
Thread Forum
Clean install error Windows cannot install required files.
This is what is happening. A friend gave me his DELL Inspririon 531 2007 Desktop. It has a pirated copy of 7 ultimate x64 (which I am not sure if this supports 64 bit). Prior to looking into how old the machine was, I was able to install 8.1 64 bit. But it wouldn't allow me to install any drivers...
Installation & Setup
How can I do a clean erase of my SSD to clean install Windows 7?
I think I have a virus or malware and have been unable to get rid of it after many tries, and I am having multiple problems with this home built computer running Windows 7Pro 64bit. I installed a retail version of Windows 7Pro 64bit and I have my original installation disk. I want to do a clean...
Installation & Setup
Clean install vs System image file install?
Could someone tell me if a re-install from a system image file on my notebook is as good as a clean install from say a retail disk. I can not format all my drive and start a fresh. Can my System image file become glitchy or infected with a virus.???:huh:
Installation & Setup
Clean Install of Win7 - Wipe Hard Drive Clean
Hi Folks, I just did a clean install of Win7 and must have done something wrong. I found a file called Windows.old.:confused: I would like to wipe my hard drive completely clean and then install a fresh copy of Windows 7 Home Premium. How do I accomplish this task? It's a good time to...
Installation & Setup
Boot config not working, tried clean install, can't install windows 7
My spouses pc all of a sudden wouldn't boot, not into safe mode or anything (vista), and so we were going to upgrade anyways to windows 7, so i bought the upgrade windows 7 and attempted to do a clean install and reformatted the c: drive which has 250gb, and each time i start the install it bogs...
Installation & Setup


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:19.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App