• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

sysprep on win7 question

equate975

Limp Gawd
Joined
Nov 13, 2005
Messages
140
I know this isn't virtual, but I figured more people in this section would deal with sysprepping then anywhere else.

It's been a long time since I have done any sysprep work (I think win 2k was the last one I did) I just have one question...

I have multiple machines from multiple manufactures, that I get new in the box. Basically all I want to do is have an answer file for the initial setup, (name, timezone, password, etc) which would be the same for every machine. After that I already have a utility I wrote to do everything else I need to do, so I just need to plop it in the run once and I'm good to go.

I may be understating this wrong, but everything I read it it wants me to customize a windows image to use, which I am assuming will overwrite what's on the machine. Which would be ok if I had the same system all the time, but I don't.

Can do I what I want to do with sysprep? Basically the end result I would like to boot off a DVD, have it answer all the questions, boot up, and run my program all without me having to touch anything until it's done.

If x86 or x64 would be an issue, I could make 2 sets of the sysprep dvd, it wouldn't be ideal, but it wouldn't make a huge difference either.
 
So I got a sysprep answer file to take care of the OOBE. I just tested it by booting a fresh install on a VM into audit mode after the initial install, applying the answer file, then booting back into OOBE.

Is there a way I can do this in PE? Like I said before, I would like to be able to boot of a disc just to write the OOBE answer file in. I'm still coming up short for info on this one.
 
When you use sysprep you generally use it to create a generalized image that will work on any machine in your environment. Using sysprep to just automate the original OEM's OOBE is imo the wrong way to do things as you are still left with all the bloat to get rid of and will generally take longer and take more effort. It also might not be possible, but i have done no research.

Here is what I think you should do, Create sysprep'd image that includes your code or means to get to your code. then create a winpe image that includes your syspreped image as well as the code to automate the application process.

In then end you will have a disk that once it is booted it will wipe and apply the image 100% automated minus the having to stick in the cd.

1. Figure out if you are going to need the system reserved partition (bitlocker)
2. On a spare machine, nuke the drive and install windows from disk
2a. If you need the system reserved partition, durring setup, delete all the partitions on the drive and let setup create the partitions for you.
2b. If you do not need the system reserved partition, durring setup, create a single ntfs partition on the disk to prevent setup from creating the reserved partition.
3. Configure the install as you see fit.
4. place your utility or a means of getting to your utility (ie a script that connects to a network share so you always run the newest version).
5. Place your answer file in the correct location, edit the runOnce setting in registry, and then run the sysprep command.
Code:
sysprep /generalize /oobe /shutdown /unattend:unattend.xml
6. Boot the machine into winpe, create a base iso if you do not have one.
7. Mount a network drive to place the image(s)
8. capture all of the partitions on the disk, as you will need both if you are using bitlocker. if you do have the special partition keep in mind that generally C is the reserved partition and D is the windows install.
Code:
imagex /capture C: z:\myimage.wim "ImageName" "Image Description" /compress maximum /check /verify

At this stage you now have an image that can be applied to any computer that should work just fine. Now you just need the means of applying it automatically.

1. Install Windows AIK on your dev machine if you have not already.
2. Read up on how to create a winPE image
3. Add your 7 image to the sources directory, as well as the system reserved image if you have it.
4. mount the boot.wim file in the sources directory.
5. create a diskpart script (will be different for the two possibilities) The follow is for a single partition setup. The BCD correction may or may not be necessary, it is possible that you may need more. Things will be different if you have the two partitions.
Code:
SELECT DISK 0
CLEAN
CREATE PARTITION PRIMARY
FORMAT FS=NTFS LABEL=System QUICK
ASSIGN LETTER=C
ACTIVE
EXIT
6. create the script that will run the automation. here is a basic example, you may need more or nothing at all to fix the bcd.
Code:
@echo off
echo --- Formatting disk
diskpart /s diskpartScript.txt
echo --- Apply Image
imagex /apply <cdDriveLetter>:\sources\myimage.wim 1 c:
echo --- Fixing BCD
bcdedit /set {default} device partition=C:
bcdedit /set {default} osdevice partition=C:
echo --- Done, reboot machine
wpeutil reboot
7. Save all of these scripts inside of the system32 folder of the mounted boot.wim.
8. Edit startNet.bat that is in the system32 folder of the mounted boot.wim. at the bottom of that script call the script you just made. This will make sure that your script is run automatically.
9. Unmount boot.wim with the commit option.
10. Create the iso according to the documentation. It will look something like this
Code:
oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso

This is all off the top of my head but it will be close enough.
 
Last edited:
Back
Top