Topic: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

HOWTO: Reinstall Windows XP preserving user data - parallel installation without a mess

Situation:
you have to reinstall Windows XP on a hard disk already containing a previous Windows XP and you can't backup your personal data because:
-you haven't partitioned the disk as C: for Windows and programs and D: for all personal data
-your previous Windows XP is corrupted and unable to boot
-don't want to write a bunch of backup DVDs and don't have an external USB HDD
NOTE: I've applied the process 10-20 times on different systems without any problem - nevertheless backing up your most critical personal data before the reinstallation is highly advised - I cannot take any responsibility if you mess up something or loose any of your data

What can you do:
-you can do a Repair Install - if you ever tried this you know that this sometimes just messes things up
-repartition or reformat your drive - you will get a clean Windows XP system but loose all your personal data
-leave the filesystem intact (aka parallel installation) - but this way you will get a multiboot setup, the new system goes under \WINDOWS.0, and there will be All Users.WINDOWS and Default User.WINDOWS folders under Documents and Settings, and your Program Files folder will be a mess

OR

-modified parallel installation: boot with BartPE, UBCD4WIN or a Linux Live CD with NTFS write support, delete \WINDOWS, \Program Files and rename \Documents and Settings to e.g. \Archive and after this preparation you launch your Windows XP Setup CD and choose Leave Filesystem Intact instead of partitioning&formatting - the setup process will do a clean install and leave your files unharmed on the disk. I'll show you how to do this in an unattended way.

The unattended way:

1. you can use nLite to modify your setup source and apply your favourite tweaks (http://www.nliteos.com/) (OPTIONAL)

2. after nLite but before the ISO creation slipstream drivers to your source with DriverPacks BASE (http://driverpacks.net/) This is a necessary step (and above that useful too - I always slipstream drivers to my source with Driverpacks so I don't have to hunt for drivers after the install) because we will take advantage of DriverPacks method 2 tweak. If you don't want to slipstream drivers I suggest you run DriverPacks BASE and slipstream the CPU drivers only - it takes on a few Kb of space in your source.

3. after DriverPacks BASE finished the slipstreaming process it will replace the original SETUP.EXE (which is called during the WinPE Phase of the setup process) with its own Fake SETUP.EXE. The DriverPacks Fake Setup calls the DriverPacks PreSetup.cmd. PreSetup unpacks the drivers from the CD to the hard disk and then it calls the original SETUP.EXE which then proceeds with the normal XP setup. We will modify this PreSetup.cmd with our batch commands taking advantage of that it gets called at the most appropiate moment of the setup process: the start of the WinPE stage which is between the text mode setup and the Gui Phase. So we integrate the following lines at the start of the PreSetup.cmd (you can find it in the I386 folder of the source)

IF NOT EXIST "%SYSTEMDRIVE%\Program Files" GOTO PRESETUP

CD %SYSTEMDRIVE%\

RD /Q /S "%SYSTEMDRIVE%\Program Files"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\All Users"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\Default User"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\LocalService"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\NetworkService"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\All Users.WINDOWS"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\Default User.WINDOWS"

:RANDOMIZE
SET BACKUPDIR=Archive.%RANDOM%
IF EXIST %SYSTEMDRIVE%\%BACKUPDIR% GOTO RANDOMIZE

RENAME "%SYSTEMDRIVE%\Documents and Settings" %BACKUPDIR%

MKDIR "%SYSTEMDRIVE%\Documents and Settings\All Users"
MKDIR "%SYSTEMDRIVE%\Documents and Settings\Default User"

REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" /v "AllUsersProfile" /d "All Users" /f
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" /v "DefaultUserProfile" /d "Default User" /f

REM FIXME <please see Issues section below> SET ALLUSERSPROFILE%="%SYSTEMDRIVE%\Documents and Settings\All Users"

:PRESETUP
...
<and here comes the contents of the original PreSetup.cmd>
...

What these script does is first it checks for the existence of "C:\Program Files" if this exists it assumes that a previous Windows installation is on the hard disk so it cleans up the Documents and Settings folder and renames it to Archive.<somerandomnumber>. After that we create the new empty Documents and Settings directory with All Users and Default User in it then we set the registry and the environment to point to these folders. When the setup process continues it won't have knowledge about the previous system installed on the same disk and this way we will get a fresh new installed system with our personal files backed up in the C:\Archive.<somerandomnumber> from where we can copy back our files to wherever we want them to be. We create a random folder for the backup in case there would already be an Archive folder in C:\.

4. Before creating our Setup CD ISO you also need to alter the contents of the I386/WinNT.sif file. You need to set the TargetPath variable under the [Unattended] section if it isn't already there like this:

[Unattended]
TargetPath="\WINDOWS"

This is necessary because if you don't set this variable the installation will take place under "\WINDOWS.0" folder if there's already a \WINDOWS directory on the partition from the previous system.

5. After that you can create your ISO from the source, burn it and pop it in for a nice Windows XP installation without losing your precious personal data on the partition.

Usage:
1. Boot from the Setup CD.
2. When Text Mode lists your partitions to choose for the new Windows install, choose the one where your old XP is already installed.
3. Select Keep the filesystem intact option.
4. Setup will ask you if it should delete the previous Windows installation, answer yes to that (L key).
5. Setup deletes your old \WINDOWS directory and create a new one for the new system.
6. After the reboot, our modded Presetup.cmd gets called which backs up the previous Documents and Settings and creates a new empty one.
7. The setup process continues further as normally would.

Issues:
Only one minor issue remained - after the setup process finishes I always end up with sharedaccess.ini placed inside C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\Network\Connections\Pbk instead of the normal C:\Documents and Settings\All Users\... place.
I believe this happens because ALLUSERSPROFILE is set to \Documents and Settings\All Users.WINDOWS by the setup process if you have a Documents and Settings folder already on the %SYSTEMDRIVE%. Unfortunately the SET command from my script (now REMmed out in the code) doesn't help in redefining this environment variable permanently because in WinPE it won't change ALLUSERSPROFILE globally - when PreSetup.cmd finishes it returns to All Users.WINDOWS. Anybody know a way to change it permanently?

Any feedback welcomed!

Last edited by mdjake (2009-01-16 08:21:50)

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Very nice!  And an excellent first post!  Welcome to DriverPacks.net!

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Thank you Smartepants.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Only one suggestion...

you incorrectly refer to the WinPE phase of setup as GUI portion.

the three stages are Txt, WinPE, and GUI. GUI mode is the final stage after the second reboot.

WinPE (Windows Preinstallation Environment) is the stage after txt mode reboots... and is when presetup.cmd runs wink
(BartPE was developed based on this stage of setup)

But i knew what you meant big_smile

Make that two ... sorry!

this is a variation of a standard "parallel installation"  http://support.microsoft.com/kb/316941 (method 4)
(you refer to this as leave filesystem intact - which is descriptive but not accurate technically)
That would be a good thing to point out at the very beginning
people who are savvy will have the general idea already in their head from the beginning  wink 
Including the keyword will also make your instructions findable to people who might use the search feature. wink big_smile
Changing the title is probably not necessary but i think saying
How To use DriverPacks when doing a parallel installation (without the mess!)
Would be helpful for finding your info and it's much more descriptive / technically accurate terminology!



Oh... and - WOW! Excellent Job!

Welcome to DriverPacks and we're delighted you posted
I second the opinion of your first post
I have not seen a better one than this!

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Very nice guide, I guess it's sticky time (has been a while wink)!

Anyhow, from what I know, you don't have to rename \Documents and Settings.
If you reinstall using even the same username, the new user dir will be named according to this scheme:
Username.Computername (as opposed to just Username).
No guaranties though as I haven't tried this myself.
Plus, renaming is definately the savest option (right after backup, hehe), just wanted to mention it (some folks may have been wonderig, dunno).

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

I thought about that too... if you were useing his PE method you could just backup the data while your there wink

PS Helmi i think you missed the boat on this one...
This should not only be stickied IMHO
- it's final version should be moved to the FAQ forum
- this should not be forgotten if/when we add attended installation support.

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Your method works OK if a REINSTALL (clean install) is needed, and it is a bit complicated.

Fred Langa documented a REPAIR procedure which can be used to update and refresh an XP install without loss of settings or user data:

http://www.informationweek.com/news/win … =189400897

I have used my customized XP install media to repair many sick and ailing systems that needed to be fully operational in the least amount of time, and it has always worked as Fred outlines it.

Just BE CAREFUL whenever you're doing this level of system re-engineering. Read twice, install once.

Thirds, a great article and thank you for your gracious efforts to enlighten us.


MARK STRELECKI

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

OverFlow wrote:

PS Helmi i think you missed the boat on this one...
This should not only be stickied IMHO
- it's final version should be moved to the FAQ forum
- this should not be forgotten if/when we add attended installation support.

Alright then, unsticking...

I didn't realize this was still under construction.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

you didn't have to unstick it...
i was just saying it is deserving of so much more !

sorry what i said did not translate well!

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Dang, nah, I am the one that missed the "only" in your sentence!

Talking about multi-tasking capabilities...


Resticking and waiting for the things to come.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Thank you all the feedback, I've updated the HOWTO a bit. I've experimented with Repair Install years ago - but I always prefer to start a new system clean and build it up from the basics (I do the same with Linux too) this way I always end up with a fast, reliable and stable system - with my nLited, DriverPacked and Winaddoned ~700 MB XP ISO I have very few post setup task to do anyway. I also don't like the .WINDOWS folders in my Documents and Settings, I prefer the defaults.

On Issue 2:
I've launced a start /wait cmd.exe process at the beginning of Presetup.cmd and from there I could map the environment in which my script needs to work. According to this as soon as the WinPE starts, you have \Windows filled with system files and setup components, two empty directories \Documents and Settings\All Users and Default User, %ALLUSERSPROFILE% set to \Documents and Settings\All Users (or All Users.WINDOWS if Documents and Settings was already present when the WinPE stage started) and the 2 reg keys for AllUsersProfile & DefaultUserProfile already created.
Anybody could explain me why I still get sharedaccess.ini in the wrong place (All Users.WINDOWS) after the process even if I set the registry keys/env variables in my script? Is there any other reference which I don't know about or it's a "feature" smile ?

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

I edited #3 for you

you still don't seem to understand that the entire section between the first and second reboot is the WinPE stage wink

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Thank you, I think I understand now and I tried to correct the nomenclature again. If there are still errors please point them out.

Last edited by mdjake (2009-01-14 19:08:26)

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

I think it is Excellent! big_smile

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Update: I've slightly modified my Presetup.cmd code in order to eliminate Issue No 1 - the code now will keep randomizing the Archive folder's name until it finds one which doesn't already exist (in case you left your previous Archive folder on the root directory before the reinstall).
I've also researched a bit Issue No 2 (the only issue remained) - the sharedaccess.ini showing up in All Users.WINDOWS instead of All Users directory. I think I have to find another way of setting the ALLUSERSPROFILE environment variable in my script other than by using the SET command which doesn't change it permanently.

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Use SetX

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

17

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

WHAT A THREAD!!! I Always wanted to do that always tried but NEVER Guessed i could do it with DP, i'd keep trying to do with DOS!
five stars to you pal! big_smile

18

Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa

Thinking a little this is extremelly useful when it comes to HP systems, cause their "setups" are just unpacking things into windows folder without checking if there IS where the actual system is instaled, and some other programs too...