# I have no clue how to create an unattended install of xp using only a usb

on
My boss has given me the project of demoing an unattended install of Windows XP on a netbook, using only a USB. I've never done this before.

He has mentioned using WAIK, sysprep, an answer file, and Windows PE. He said I should be able to do it using a Windows 7 reference machine.

I've searched quite a bit on the Web, and I've been unable to find the exact info I need on how to complete this.

This is just to demo for my boss right now, but it will be eventually used in a production environment where they are installing xp to thousands of netbooks on a production line. But my boss wants to see how the unattended usb install will work for now.
Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2011

Commented:
Nlite should be able to help you with this, to make it easy.....
http://www.nliteos.com

SCCM Engineer

Commented:
The WAIK is only for Vista/7 as far as I know.  Now, you can use WinPE + ImageX to take a snapshot of a Windows XP image, but you still need to use the legacy plaintext unattend file and not the SIM in the WAIK to create the unattend file.
Also, as far as I know, Windows XP does NOT support USB devices during the initial installation, as it's really a MS-DOS based loader.  Vista/7 does support loading unattend files from USB devices.
Maybe your boss is getting confused between XP and WIndows Vista/7?
And if there's thousands of netbooks to do, why not use an imaging approach?  That can be easily done from USB.  I do it all the time at my company and it's pretty slick.  You just use UNETBOOTIN (http://unetbootin.sourceforge.net/) to boot the WinPE iso into memory using the GRUB bootloader.

Commented:
He's under the impression that I can use my laptop, along with WAIK to create whatever I need to create, windows pe/sysprep/unattended answer file, wim, etc,  so I can create this usb, so it performs an unattended install. However, he's put this on my plate, because he's not 100% knowledgeable regarding WAIK/AIK, and was going to have one of the I.T. guys give him a 1 hr crash course, but I.T. wouldn't allow the tech to be loaned for that purpose, thus its on my lap.

I'm looking at nLite, as you advised. I wanted the easiest solution just to get this off my lap. I do have somewhat of a tech background, but mostly in NOCs, doing monitoring. Granted, I am learning a lot more about XP, and the associated files, but I just want to finish this thing. I'm hoping nLite does the trick. There's plenty of info regarding doing a network or CD install, Ghost, etc, but not as much regarding XP and unattended installs on a netbook.

Regarding WAIK, he said that I can use it as a technician computer to create a xp image using PE/Image X, etc. Don't know if this is true or not. So much info out there, and I've only found bits and pieces that apply to my project.

The initial project which I'm on, is to demo the unattended install of XP via USB on a single notebook. The idea being that it will be duplicated, probably after some changes, so that production can perform the same install thousands of times, using USBs.

I hope this makes sense, because my head is spinning. lol

I appreciate both of yours advice, and I'll work on this today and tonight, and post any questions and concerns that pop up. I will post even if its successful. This project is stressing me out, and it probably shouldn't.
It Support

Commented:
I looked at doing this afew years back for about 250 laptops and PCs. In the end, I decided the easiest and quickest (for me) was to run a sysprep set up adn then image the disk with ghost and then do a network boot/image copy using NDIS network drivers. On a gigabyte cross over cable I could create a fresh PC in about 6 minutes - all preloaded with office and a few other applications. Ghost worked out at about £15 per machine and, as we got £40 per PC we built it worked really well (and the client had a valid Ghost license for each pc afterwards). Not a 'no cost' option but, the gost setup can be pretty automatic using bootable cd and a simple bat file.

Commented:
Why not use Windows Deployment Services? Its free and quick and doesn't require extra devices. Once you have the standard netbook setup how you want it you can capture the image and deploy to the remainder.

A quick guide to WDS. You can't deploy vanilla xp from WDS but you can capture an image then redeploy it.

I'm obviously basing this on the fact you have a windows based domain - if not then just ignore me!

Commented:
I have no idea why this is the option he is choosing, or if its just a test. In my department, we're often expected to create the cheapest (free) solution, with the best results.

No its a Windows domain. I work for a VAR, and its for netbooks that they're going to throw, what I would expect is a standard image, for shipping to the end user.

Commented:
Similar to me. We are an OEM an push out various models of machines and software. When I joined 6 months ago the guys still used CD/DVDs to install windows. I've installed MDT and WDS on a spare server and it has made a big difference in time and accuracy of installs. The guys boot from the network and kick off either an image (WDS) or task (MDT) and leave it, under 30min later (WDS) the machine is finished and ready for QC.

It takes a bit of time to get your head around the two technologies (but not long) but it is worth it in the long run. I reckon once you have this solution working the next step will be something like "can we get office 2010 installed as well?" etc etc. With MDT and WDS you can add software and drivers as you need to keep up to date.

Commented:
That's something I need to present to my boss. It certainly makes sense to implement, or at least consider that long term. Short term, I'm gonna try nLite, as using AIK/WAIK, seems much more involved than I want to get, if it will even work.

Commented:
Alright, I'm confused with nLite. How do I make the files to make the USB bootable, and unattended? Seems the only options is an ISO.

Commented:
SCCM Engineer

Commented:
I read through those links and it's a "hack" method as I would expect it to be.
Essentially, they install XP USING flash drives, but not FROM the flash drive.  They use two flash drives.  The first one is a standard MS-DOS floppy written to a USB drive.  You use this drive to partition and format the drive, then you insert the 2nd USB flash drive and copy all the WIndows setup files to the hard drive.  Then you kick off the install of XP with WINNT.EXE which is the MS-DOS setup bootloader.  This is able to modify the boot sector so when the computer reboot, the setup just continues on with the installation without the need of the USB drive or a CD-ROM drive.

Commented:
Ugh. I appreciate all the help, but I'm confused as to when I get to the end of the nLite page, it pretty much only gives me the option to create an ISO. How would I create the files necessary to make the USB bootable?

Commented:
Unfortunately, as I'm loading this on a netbook, don't remember if I posted it as a notebook earlier, but that limits me to a USB install.

Commented:
"And if there's thousands of netbooks to do, why not use an imaging approach?  That can be easily done from USB.  I do it all the time at my company and it's pretty slick.  You just use UNETBOOTIN (http://unetbootin.sourceforge.net/) to boot the WinPE iso into memory using the GRUB bootloader."

Aleinss,

How do you do that? Is that server based? or does everything run off the USB?

Commented:
http://liliputing.com/2008/04/install-windows-xp-on-mini-note-usb.html

Seriously consider imaging - it won't take long to get setup

Commented:
I'm gonna try that. Thanks. Again, I just want this off my plate, so i can demo it. This has been a major pain in my you know what. lol
SCCM Engineer

Commented:
Yes, you take the WinPE ISO you create from the WAIK, then you write that image to the USB flash drive with UNETBOOTIN.
See http://www.leinss.com/blog/?p=173 for a general overview.
Essentially, you can put your WIM file (Image of PC) on a server, PC, etc.  Anything that can be setup as a Windows share.
Then you format and partition the disk with diskpart from WinPE.  Then you map a network drive from WinPE to that Windows share.
Finally you lay down the XP image with ImageX+GImageX.
Or
If you don't want to mess with networking, you can copy the WIM file right to your USB stick, however, your USB stick will need to be larger than the WIM file.  So if you have a 4GB WIM, you probably want a 8GB USB flash drive to hold WinPE + your image.

Commented:
I tried the win to flash thing, and I received an error that the ntldr was missing. Can I manually move that file to the USB, or how can I fix that?
SCCM Engineer

Commented:
You probably need to re-format the USB flash drive and then try it.  NTLDR is the boot loader for XP, BOOTMGR is the bootloader for Vista/7 and is what WinPE uses in the WAIK.  Also, you will need at least 512MB of memory on the netbook to use WinPE

Commented:
Ok, I'll try that. I believe that the netbook as 1 GB or Ram. I'll give it another shot. Thanks again everyone for their quick response.

Commented:
I've tried twice, working on third time-double checking that I'm doing everything correctly, as the two previous times I've encountered the NTLDR file is missing. Press any key to restart.

From what I've Googled, the NTLDR file needs to be in the root, but is in the i386 folder. Is this correct? I honestly have no clue.

Also, I would assume that the motherboard will accept a USB start, as that is an option when I go into the BIOS. Is this a correct assumption?

Thanks again.
SCCM Engineer

Commented:
Looking at my USB flash, ntdtect.com and ntldr are in the root of the USB drive, not i386

Commented:
Do I just move the files manually to the root?

Here's exactly what I'm doing, step by step. Maybe I'm missing a something along the way.

I throw in my USB, format it.
Start USBtoFlash
confirm my source path, which is my CD
and USB, which is E:
check my setup parameters, and nothing is checked
Process steps, everything is checked by default
Format: flash card or stick, usb+hdd, fat32 LBA, checked under select this paramters auto under MBR config (default is was checked)
Active 0x80
partition fat 16 chs
chs begin, all zeros
chs end, all zeros
LBA of first sector, zero
LBA size, zero

under FAT 16/32 config, the box was checked, "select this parameters automatically"

I click "run", after confirming source and target path
also, "remove the read-only attribute from files" is checked by default

accept the Win Lic Agree

continue, and it starts to copy

last two times I've received a dialogue box, Novicorp WinToFlash can not lock the drive, Please close the applications may use this drive and press Retry.

Nothing else is using it, so I just hit retry, and it continues formatting the USB , and copying files

Transferring Windows Setup "finished", I click on "ok"

I then go to Win Explorer, and eject the usb safely

Plug it into the USB port of the HP mini, and reboot

and I get the same error. I'm going to try and manually move the three files aleinss mentioned to the root, and try the reboot on the target machine again.

Commented:
I meant 2 files, boot.ini is already at the root

That seemed to work, to an extent

I get
1, text mode
2, gui moe
debug
and a bunch of other debug boot rDisk options

Is there a way to make it so that it automatically goes into install mode, with any input from the installing person/tech?

This is definitely better than what I've been getting.

Commented:
I just tried clicking on "text mode",

and it gave me the dreaded NTLDR is missing error again. Its the NTLDR located in the root, and a folder?
SCCM Engineer

Commented:
Unforunately, I can't help: I assumed you were going the WinPE/ImageX route.  I am unfamilar with the product Win2Flash.

Commented:
I'm looking to accomplish this anyway possible. My boss mentioned the WinPE/Image X route. I'd rather do it that way, as that is what I would assume my boss is expecting. The WinToFlash product was mentioned in here.

I'm all ears, believe me. I know little if anything about PE/Image X, but would prefer to do it that way. But in the end, I just want something to show.

Where do I start with PE/Image X? Do I need to use AIK?

Commented:
I just looked back in the comments, and saw you mentioned unetbootin. I've downloaded it, and I'm going to try it tonight.
SCCM Engineer

Commented:
You can use any version of WinPE with ImageX/GImageX.  I would start with BartPE (probably the easiest to work with since it's all GUI) @ http://www.nu2.nu/pebuilder/.  For the ImageX files: you will need to download the monsterous WAIK.  You can then copy the ImageX files from the installation directory to your WinPE medium along with GImageX.
Do the hard drives have any OS on them right now?  That will dictate whether we have to worry about wiping the drive and installing a boot sector.

Commented:
the laptop which I use has 7, and the destination notebook already has xp. This is a demo deployment, that they're planning to eventually use for a mass deployment, just a generic install from what I know. But for right now, its an install on one notebook, so my boss can digest the process, and success, speed, etc, for eventually mass deployment.

I'll try it tonight. Thanks!!
SCCM Engineer

Commented:
If it makes easier, these are the ImageX+GImageX files from my project from 2 years ago:
http://leinss.com/files/winpe_imagex.zip
Essentially the same as you would find in today's WAIK.
SCCM Engineer
Commented:
If XP's on there already, we don't have to worry about the boot sector.
You will want to sysprep the image on the notebook.  You should be able to find this under the deploy folder on the XP cd.  Run setupmgr.exe and that will create a sample sysprep.inf for you.  Copy this file and all the sysprep files to C:\sysprep.  Make sure you have a backup copy of this folder as sysprep will delete it eventually.  Run sysprep and the notebook should shut down.
Then you will boot into WinPE, launch GImageX, click the Capture tab, capture the image to the USB flash drive (or network drive).
Exit out of GImageX after image. Wipe the disk with diskpart.
Now relaunch GImageX, click the Apply tab, click the WIM you made, then C: for target.
After it applys the image, reboot the laptop.  Depending on what you put into sysprep.inf, it should either be hands free or ask for very little information (such as computer name).
That should be the demo...

Commented:
Will I need to create an unattended answer file?
SCCM Engineer

Commented:
If you are using sysprep, sysprep.inf will be your "unattend" file.

Commented:
I'm running the instructions here:

http://windowsconnected.com/blogs/joshs_blog/archive/2007/02/05/creating-a-bootable-winpe-2-0-usb-key.aspx

to create my Windows PE disk, but I get an error:

Status: 0xc000000f

Info: The boot selection failed because a required device is inaccessible.

I did config the BIOS to boot from the USB first. I'm assuming the instructions on that site are spot on, as someone else followed them without any problems.

Just so I'm clear, do I run setupmgr on the "technician" machine? and sysprep on the target machine, since there is already an OS on there, as this is just a demo.

I'm less confused now that someone has been able to explain it to me, but just trying to put some pieces together.
SCCM Engineer

Commented:
You can run both from the XP machine.  Obviously, you want to run the setupmgr.exe first to create the INF file and then make a backup copy of this file.
In terms of the error...I would try building the WinPE 2.0 disc this way (I've used these instructions in the past and know they work):
http://www.svrops.com/svrops/articles/winvistape2.htm
Make an ISO, then use UNETBOOTIN to uncompress the ISO to your flash drive and make it bootable.

Commented:
I really, truly, want to thank you for being so prompt with your help and answers. I'll try that next. Thanks again.

I'll report back with my results, problems, issues, or success (I hope) etc.

Commented:
Also, while I'm thinking of it. Should I screw it up, by formatting the drive, and the unattended install fails, how could I go about doing the same thing, but with the idea that there is no OS on the target machine.
SCCM Engineer

Commented:
If there's no OS, you will need to install the XP boot code and then create/format a partition with diskpart.
Bootsector:
bootsect /nt52 sys (should be in the ZIP file I attached)
Diskpart:
(Run diskpart, then type each line, followed by the ENTER key)
select disk 0
clean
create partition primary
format quick
active
assign letter=c
Then click the APPLY tab, pick the WIM and C: for the target, then click OK.  It should apply the WIM.  When done, exit out of GImageX, then WinPE and then reboot.
SCCM Engineer

Commented:
The tricky part with a USB flash drive and no OS is that the C: drive (C: letter) may be assigned to the USB flash drive, so you may have to do the above, reboot with the USB flash drive again and then it will properly assign the C: drive to the partition on the hard drive (since it now exists).

Commented:
following along on the svops page to get my winpe up and running, and for some reason I can't run the peimg commang.

I receive the error, " 'peimg' is not recognized as an internal or external command, operable program or batch file"

I'm going to be spending all evening to get something up and running. I've got to demo it this Friday morning for the boss.
SCCM Engineer

Commented:
When you install the WAIK, there should be a Windows PE tools command prompt.  You need to right-click on that and then run that prompt.  It will set the paths right.
Should be something like...Start > Programs > Microsoft Windows AIK

Commented:
When I look in the x86 tools folder, I don't even see a peimg exe file in there. I see an imagex exe and an oscdimg exe, but not the peimg. I have no idea what I'm doing wrong. This project is driving me crazy, I'm reading to launch my laptop against the wall. I'm sure that for most of you this is easy, or would be, but I rue the day my boss game me this project, knowing full well I've never imaged a device this way. Ugh

Commented:
Ok, minor update.

Found some AIK files  the boss "made", and allowed me try and figure out.

Think that I got the PE disk to work.

Copied the folders: boot, EFI, servicing, and sources....files bootmgr, imagex.exe, and wimscript.ini

booted the flash drive, and I'm at:

x:\windows\system32>wpeinit
x:\windows\system32

does this sound good so far? Just to get this demo done. I home to Jeebus he doesn't make me take it to the next level.

I'm guess next that I need to create an mage from the test pc, and get it into PE, so I can get puppy running. I hope this is correct, and I hope this makes sense.

Commented:
"Copy this file and all the sysprep files to C:\sysprep."

do I copy this to the technician machine, or the test machine?

Commented:
At this point, if I can piecemeal something together from what I have, I'm fine with that. I also ran setupmgr on the target, and it provided me with the following files

unattend.txt
unattend.bat

where do I put these? do I need them, either of them?
SCCM Engineer

Commented:
You don't want a unattend.txt file: that is if you were installing Windows from step 1.  You want to create a sysprep.inf which is an unattend file for sysprep.
Unattended installation of Windows XP = unattend.txt / Sysprepped image = sysprep.inf
You copy all of the sysprep files to C:\sysprep on the test machine and then run it (make sure you keep a copy somewhere as this folder will get deleted).  It will then shutdown.  Go ahead and power it back up and let it run through the minisetup.  If that looks like it worked, then go ahead and run sysprep again, let it shut down.  Then boot to your WinPE disc and take an image with GimageX/ImageX.
GImageX is available here: http://www.autoitscript.com/gimagex/
Once it gets to the command prompt, go ahead and run GImageX to get the GUI.  You will probably want to copy this to your USB flash in the same place imagex is.

Commented:
and after running it from the gui, will be be unattended/mostly?
SCCM Engineer

Commented:
Yes

Commented:
I'm planning on spending all day and all night until this is done. I have the feeling I'm about half way there, by virtue of getting PE to start.

Question: How do I run ImageX from PE. Do I just enter "ImageX" at the prompt? Because i did, and nothing happened.
SCCM Engineer

Commented:
When you copied the files to the USB drive, where did you put them?  You might have to change directory.
The default starts at X:\windows\system32, so if you made a folder called image, you would need to do a cd\image from te command prompt.

Commented:
that sysprep inf file is created from running sysprep? Or how is is created. I couldn't find it on the XP CD, deploy zipped folder
SCCM Engineer

Commented:
It's created by running setupmgr.
After it's created, you may want to add additional options, here's a video guide:
http://www.vernalex.com/guides/sysprep/video.shtml (ignore the directions to change the HAL to APCI.  If your netbooks are brand new, you shouldn't need that)

Commented:
Can I just rename the unattend file sysprep.inf?

Also, I ran sysprep, it shutdown, and now I'm at "Welcome to MS Windows" is that what I'm supposed to see? Is that the mini setup?
SCCM Engineer

Commented:
Yes, that's the start of it.  I don't think you can just rename unattend.txt to sysprep.inf, I think the syntax is different.

Commented:
how far does the mini setup go? does it go so far as having your accept the EULA and enter in a serial?
SCCM Engineer

Commented:
All of that can be bypassed in the sysprep.inf, but yes you will get the EULA, serial number, computer name, and network identification

Commented:
Where is that inf located? When I run through setup mgr, it creates a file "unattend.txt"

Maybe I'm doing something wrong. Here's the steps I've followed:

Welcome to Windows Setup Manager Wiz---next
Do you want to create a new answer file/modify old one---new one, right?
Product to Install---Windows Unattended Install is what I selected, or is it sysprep install?
Win XP Pro
User Interaction Level----I selected Fully Automated
Distribution Folder---since I'll be doing it off the USB, I selected "No, this answer file will be used to install from CD"
Accept the EULA
Name---I just entered "User", no "Organization"
Display--defaults
Time Zone--I selected Central, as these would ship to US locations, but the demo is for here in central.
Product Key---what was on the bottom
Computer Name--its an HP Mini, so I just entered Mini..as it didn't like HP when I entered it.
Networking Components---"typical settings"
Workgroup or Domain---left the defaults
Telephony---just selected US for country
Regional Settings---"use default..."
Languages---did nothing
Browser and Shell Settings---left default
Installation folder---left default, "a folder named windows
Install Printers--nothing
Run Once---nothing
clicked "Finish"

Informed me that Windows Setup Manager created a file D:\unattend.txt and unattend.bat

Setup Manager Complete

Commented:
Just found that answer..should have selected "Sysprep install" to create the inf file

Commented:
Cool, got the inf file done.

New question. Just put the inf file in the c:\sysprep folder on the target machine, but I noticed that there is a i386 folder in there.

Does it get created through running setupmgr, or maybe I put it there on accident?

Question being, should I leave it, or delete it?

Commented:
Also, should I keep the copy of the inf file on the usb which I plan to use for the demo install? Is it necessarily after capturing the image of the target machine? Or is it just used during the sysprep, capturing of the image?
SCCM Engineer

Commented:
You can leave the i386 directory, I believe it's there for OEM textmode drivers.
The sysprep.inf is just used once after the image.  However, if you want to update the image and take another snapshot, you would need to re-sysprep the system and therefore would need the sysprep files and INF again

Commented:
Ok, so based on all the babble I've typed, I would guess that the next step is to sysprep the image. At least I'm half, or maybe more than half of the way there.

How do I start the imagex program from the command prompt.

I'm going to throw Gimagex on there as well.

Also, let me post the files I have at the root of my USB, just to make sure they're correct, before I start the whole sysprep/GimageX process

in order, from top to bottom

boot
EFI
Servicing
sources
sysprep (I made a copy and placed it here. I could certainly delete it, or move to my other laptop/tech pc)
bootmgr
imagex
setupmgr (guessing I don't need this one either?)
gimagex

Commented:
"Then you will boot into WinPE, launch GImageX, click the Capture tab, capture the image to the USB flash drive (or network drive).
Exit out of GImageX after image. Wipe the disk with diskpart.
Now relaunch GImageX, click the Apply tab, click the WIM you made, then C: for target.
After it applys the image, reboot the laptop.  Depending on what you put into sysprep.inf, it should either be hands free or ask for very little information (such as computer name)."

Questions on this.

When I exit out of GimageX, and diskpart the target HD, should I remove the USB, or keep it in the drive?

Do I reboot to relaunch GImageX, or just launch it from the command prompt?

Also, not to complicate things, but is there a way to get the diskpart be performed unattended? I'm not trying to do that with this, but just for my own knowledge.

Commented:
I'm missing some folders, I'm going to create a second USB, and copy my first USB, then add the files I believe are missing, and then try that one.
SCCM Engineer

Commented:
In terms of the files:
I believe you need wimapi.dll, wimfltr.sys, bootsect.exe and wimfltr.inf as well.
They should also be in the ZIP I linked above.
I would keep the USB in the drive as you will be running commands from it.  Just reboot the computer and reboot to the USB drive.
Yes, you can script diskpart: http://www.leinss.com/blog/?p=173

Commented:
"wimapi.dll, wimfltr.sys, bootsect.exe and wimfltr.inf"

do these go in the root of the usb?
SCCM Engineer

Commented:
They would go where ever you put imagex.exe since it uses these files.

Commented:
Ok. I believe that I have most of the files, but I'll probably have to recreate the whole process, just to make sure. With your help, this has all made a heck of a lot more sense, but I'm still a bit confused.

I'm going to just stay up all night, since tomorrow is Friday and I can catch up on sleep over the weekend, as I want to get this done. Hopefully it will all just sink in, and bing, bang, boom, I'll be done.

I'm sure that in the end I'll realize that I'm making this a lot more complicated that it is, but I've been going in circles, as I've never done this before, and I tend to get aggravated when I get lost doing something.

SCCM Engineer

Commented:
I think the "problem" is/was trying to using an unattended installation in the first place and restricting that to USB devices only.  Vista/7 from Microsoft is actually delivered in WIM (image) format, so I have no idea why your boss would insist on using an unattended install.   I've always used imaging for deployment and for creating batches of new laptops, the image route is what HP, Dell, Acer, etc. use.  When you go to recover any of these PCs, they always use an image based solution.
The only place an unattended installation makes sense is if you had to build a bunch of different PCs with lots of different hardware.  Here, image based deplomynet takes a lot more work in the sysprep stage, because if you don't get it right it will fail (BSOD)  and there's no easily fix vs unattended you can load the drivers as you go.

Commented:
I agree. There seems to be tons of info available on how to use WAIK to perform an unattended install, even via USB, but scant info on how to do it for XP, on a netbook, using a USB no less.

I even asked him if I should perform the demo using Win 7, as WAIK seems to be much easier to use, and from what I've read, USB's are no problem, provided the target machine satisfies the requirements for Win 7, and that you have a large enough USB.

Seeing how I'm assuming this is going to eventually be developed for deployment of netbooks using Win 7, I just don't know why he didn't have me go that route, and I could have been done last week. Not because I know Win 7 or WAIK that well, but there's just much more info available online regarding the two. As well, in general the newer OSs are generally more attractive to those who are looking to buy a new machine, and based on my limited knowledge, people buying netbooks generally aren't power users, but rather people who want something light to access the Web, their email, and some other general applications.

The unattended part I get from his perspective, as being a VAR, and I'm in a Engineering support kind of role. The actual people who will be imaging these machines will be line workers, and not actual techs, myself,  or I.T. people. The idea being that they want this as simple as possible, and the less buttons they need to push, the more products they can "push" out the door, with less chance of error.

While I have definitely learned more about the process, the files involved in XP, etc, I'm also aggravated this was thrown on my desk, when I mentioned to the boss that I had zero experience in this stuff. Supposedly there's a guy in I.T. who has experience with AIK, but his boss was unwilling to allow him to give my boss a crash course on the whole process. On top of that, my boss is a know it all, and is fully convinced that it can be done using WAIK and Win7 on the tech machine, and is rather annoyed that its taken me this long to get it done, but I need to bite my tongue.

My plan is to just bust it out and get something to demo him based on what you've provided me. I feel that I'm pretty close, and definitely a lot closer than I was just a couple of days ago. I'm bringing three of these netbooks home, just in case I mess up. Once I get the files organized, and the imaging done, it should be a piece of cake. I'll just start from scratch, as the more I do this, the more it sinks in.

However, don't be surprised if I throw a question or five out there tonight.

Thanks again for all your help.

Commented:
Big time help. consistently followed up with my questions on here, in spite of what were probably poorly worded (technically) questions at times.
SCCM Engineer

Commented:
Fire away.  I've been using this method for 2 years and it beats buying Norton Ghost or another imaging product.

Commented:
"I believe you need wimapi.dll, wimfltr.sys, bootsect.exe and wimfltr.inf as well."

Where would those files go? Can I manually move them from the zip file to the USB?
SCCM Engineer

Commented:
The w* files go with imagex.  The bootsect.exe you can put anywhere (I would probably put it in the same folder as imagex).
They should work fine if you just move them to the USB drive.  I actually have all the support files on a network drive (GImageX, ImageX, bootsect.exe, etc).  I also have a DOS batch file that I use as a simple menu (disk wipe, boot sector install, run GimageX).  If I need to update the batch file, I can just update the copy on the network and don't have to worry about outdated copies hanging out there.
For simplicity: you probably just want to copy the WIM file to the USB flash drive so you don't have to wrestle with networking support.

Commented:
Thankfully, my boss has given me a stay of execution, sort of speak. Project is now due today, as he has realized that this is "unchartered water" (his words). It still needs to get done, but gives me more time.

What I'm planning on doing is starting over from scratch. With the pressure off, I wouldn't be surprised if this clicks. What stinks, is it seems that I run into roadblocks when certain things don't work, even though I've followed the steps or outline to the word.

You've been awesome aleiss. At this point, if you have better files, I'm not too proud to use them.

Thanks for everything.
SCCM Engineer

Commented:
No problem.  I'm using the same files as you have: they are just updated for Windows 7.

Commented:
I read that imagex goes in the mount\windows\sys32 folder, is that correct? Actually, I've read a few different things, but that one sticks out.

Commented:
All this playing around with Windows, has made me consider going after MCITP certs, instead of finishing my CCNA. Its interesting, but a pain in the arse learning so much, so quickly. But I do enjoy a challenge.
SCCM Engineer

Commented:
You should have 2 copies of ImageX: one that the WAIK installs on the technican PC and one that you install on the USB flash drive.  You use the ImageX on the technican to modify and add things to your WinPE image.  You need to run this as given in comment 33953112 above.
You then need to copy ImageX from the technican computer to the USB drive so you can apply/capture WIM files (see image)

winpe.png

Commented:
This is where I get frustrated at. I create the pe folder on my c: drive, and it says that it copied "peimg", and yet, when I try to run it, it fails.

Not the best screenshot below, but just some evidence that I'm not going nuts.
peimg.png

Commented:
Never mind, what a lousy screenshot. Yikes
SCCM Engineer

Commented:
I think the problem from your screenshot is that you are using the Windows 7 WAIK and not the Vista WAIK.  peimg is used in Vista's WAIK and Dism is used in Windows 7 WAIK.  The instructions @ http://www.svrops.com/svrops/articles/winvistape2.htm are for the Vista WAIK only.
If you want to use the Windows 7 WAIK, ignore the instructions on the web site above and use the CHM @ C:\program files\Windows AIK\Docs\CHMs\winpe.chm.  Then the section Building a Windows PE Image.

Commented:
Nice. I will look at that. I told my boss yesterday that I couldn't figure out why some of this stuff isn't working. That will probably help.

Ah, so DISM instead of peimg. I knew that I wasn't totally losing what's left of my mind.

thanks

Commented:
nice heads up with regards to the chm files. Difference is night and day created PE.

Commented:
Now with DISM, I can actually mount the wim, and add things to it. Now I've gotta figure out how to put it all back together. But that's what the weekend will be for.

Also, I have the volume license number, so I know that I can get through sysprep and sysmgr, and then once I get Gimagex or Imagex working from PE, I'll be that much closer.

At that time, and only when I've confident its all done, I want to configure it so that the USB will format and partition the drive before installing XP, if that's possible.

Commented:
back to the grind. I've got building the basic PE folder down, and it boots to:

x:\windows\sys32\wpeinit
x:\windows\sys32

Still can't figure out how to add imagex and/or gimagex

I didn't get the chance to work on this over the weekend, and prob forgot a bit.

While I can see imagex at the root of the WinPE USB in Explorer, I can't seem to find it, or run it, for the command prompt in PE on the target machine.

These are the folders I show at the USB root while in Explorer:

boot-conatins fonts/bcd/boot.sdi/bootfix.bin, and etfsboot
EFI--contains microsoft/boot and some other stufff
Sources--contains boot.wim   which I was able to mount, and add some basic packages using dism
bootmgr
imagex

I'm a bit confused why I can't get imagex to run. It doesn't seem to be in the correct folder..Am I missing folders?

I have not yet sysprep'd or run setupmgr, as I want to get the PE part down cold before I image the target. Setupmgr and sysprep seem rather easy. I just feel that I'm missing a step or two to get this running fine.

After I'm able to successfully get this complete, I'd like to add a script so that the target will format and partition itself. From what I've read, I'd need to mount the wim to add the script package, could be wrong, but that's how I interpreted it.
SCCM Engineer

Commented:
You have to CD up to the right directory.
cd \imagexdirectory
See http://ss64.com/nt/cd.html

Commented:
When I use dos on my tech machine, I see them both, but when in PE, I can't find it at all.

Should imagex/gimagex typically be at the root of the USB?
SCCM Engineer

Commented:
Ah, X: should be the RAM drive.
So it is probably assigning the USB drive to another letter.  Try Z: or Y:, if that doesn't work, try D: or E:

Commented:
K. I'll give that a shot

Commented:
I found it, its seen as the "d" drive

dir d:

however, I can't cd to d:

x:\cd d:
d:\

x:\

it just throws me back to x:

Nevermind, ran

x:\> d:\gimagex.exe

that brought up the gimagex app

Is that correct?

Exit out of this, and sysprep the target machine. I've already created the *.inf file using setupmgr. It's saved locally on the target machine, in the c:\sysprep folder

I don't need to save the *.inf file, as I'll assume that it will become part of the image (wim)?
SCCM Engineer

Commented:
To change, you just type D: and it will change to D:.
Once you sysprep the machine, it will shut down.  Take a snapshot then and yes, sysprep.inf becomes apart of the WIM until sysprep deletes it

Commented:
Another question:

"Then you will boot into WinPE, launch GImageX, click the Capture tab, capture the image to the USB flash drive (or network drive)."

Where is the image saved to when you sysprep the target? Is it saved into the sysprep folder on the local hd?
SCCM Engineer

Commented:
Sysprep just preps the machine for imaging.  You have to image it with Ghost, ImageX, etc. after sysprepping the machine.

Commented:
If so, I see in the sysprep folder

>>>i386
>>>>>>$oem$

Assuming one of these is the source, the destination is the d: drive/removable disk.

Commented:
Ok, running setupmgr

It says "Completeing Setup manager"

created the following files:

C:sysprep\sysprep.inf

back and next are greyed out, and cancel is not..can I just close this out, or is something still being created necessary to my next task?

Just to clarify, running gimagex and clicking capture doesn't really capture anything, or does it. Running sysprep doesn't capture the image. How would I image it with imagex or gimagex?

Sorry for being such a pain. I appreciate your help as always.
SCCM Engineer

Commented:
You should be able to run sysprep -mini -reseal from a command prompt, that will sysprep the system and shut it down.
Yes, clicking capture does capture the file system on the C: drive and turns it into one file, the WIM.

Commented:
How do I capture the image?

I see that there is a capture box, but where is that file saved on the target machine?

I see source, destination (which I would assume to be the USB). Where do I grab the source? I launched gimagex

Commented:
Also, I see an option for a config file. Do I need to create that? Or will the inf pretty much take care of most of it?
SCCM Engineer

Commented:
You want to save it back to the USB drive, D:.  Now, eventually, you could store it on a network drive if you wish, but if you want to image other laptops with this WIM you will back to save it to the USB drive or a network drive.
SCCM Engineer

Commented:
Source would be C:, destination would be the drive letter of the USB drive.

Commented:
Does it matter what I name the image? Or does it just look for a *.wim when reimaging?
SCCM Engineer

Commented:
You can name it whatever you want. You re-apply it by clicking Apply and then clicking on a WIM

Commented:
Thanks for the quick reply. "Imaging Operation In Progress". No pressure if it doesn't work the first time.

What's odd is, I was doing the same thing everything to get the PE disk to just boot up. Even though I followed the exact same directions from several different sites.

It wasn't until I started using DISM, that it started working correctly. Even though that would have nothing to do with it. Well that, and looking at the chm files.

Somewhere I must have missed a step, even though there are not that many. the only other thing that I did differently was a quick format vs a full format of the USB.

Commented:
"After it applys the image, reboot the laptop.  Depending on what you put into sysprep.inf, it should either be hands free or ask for very little information (such as computer name)."

Do I leave the USB plugged in after/during reboot?
SCCM Engineer

Commented:
When you sysprep the machine, it shuts down.  Then you take an image.  After you image the PC, you can remove the USB drive.

Commented:
Messed up the diskpart, so I had to reformat the hard drive.

Gonna run gimagex, applying the wim, overnight...as I'm walking out the door.

After I'm able to get this done successfully, I've gotta figure out how to make the inf/answer file do even more.

Plus, I want to automate format and partitioning the drive via the USB.

But I've gotta walk before I run.

Commented:
Wow, looks like it worked.

Although it gave me the admin logon prompt..How can I change, whatever I need to "inf, etc", so that I get the OOBE?

Also, would I add the win script package to the wim, and then add the batch so that I can format and partition the drive automatically from the USB?

Just want to clean a few things up before I present to the boss.

Other than that, it was pretty much automated, which rocks!

Thanks aleinss!!!
SCCM Engineer

Commented:
During setupmgr, there should be an autologin feature.  You can use that to get to the desktop without logging in.
To automate this, you can do something like this in startnet.cmd (attached).
If you put an "exit" command at the end, it should restart when done.

diskpart -s diskprep.s
imagex /apply somefile.wim 1 C:\


Commented:
Do I create a new setupmgr, to create a new file?

I don't mind playing around with this, as the netbooks which I'm testing this on are exactly the same. The boss said to do what I want with them.
SCCM Engineer

Commented:
No, that isn't necessary.  Just take notepad, open sysprep.inf and under the section [GuiUnattended], put AutoLogon = Yes
Once you create sysprep.inf, using setupmgr to modify it isn't really necessary.  In fact, when I created my sysprep.inf, I just used someone else's template and built off of that just using Google, notepad and experimentation.
Unforunately, the exact opposite is true with Vista/7 where the new format is XML and you really need to use the SIM to create the config file.

Commented:
Yeah, 7 is the next project. Apparently this isn't being rolled out till late 1Q, as the 4Q here is the busy time. Eventually they want to implement WDS, but this project of mine is more of the initial testing and demo phase.

Is startnet.cmd on the PE disk by default?

Just to clarify "somefile.wim 1", somefile being whatever I named my wim, correct?
SCCM Engineer

Commented:
That's correct.  Startnet.cmd in X:\windows\system32 is autoran in WinPE every time you boot to it.
somefile is whatever you named your file.

Commented:
How would this process be different if it was an install on a blank netbook?

I had to format the drive, messed up while partitioning, and everything ran according to plan, other than the admin logon part-no a big deal at this time.

I'm guess that the only way to edit the inf is during the setupmgr phase? or would it reside in my new wim on my usb?

I did save my files from when I syspreped and setupmgr'd the original machine.

Since I 'm doing this process on identical machines, should i just edit the inf from my original machine, sysprep and re-capture the image, and run it again?

Commented:
How would I edit "startnet.cmd" Could I only do that in setupmgr?
SCCM Engineer

Commented:
Once you make a WIM, you use it for all computers, unless they are different hardware.
SCCM Engineer

Commented:
You have to mount the WinPE WIM with DISM and then you can edit it with notepad.  Please consult the WinPE CHM

Commented:
Ah, so the files become visible in Win Exp when you mount. them. Eureka!

Commented:
When I attempt to open startnet with notepad, all that is in there is "wpeinit"

do I simply add what you typed earlier to that notepad doc? I would assume the numbers. 1 and 2 aren't necessary.

I'm just being really cautious, as I've finally come this far, and don't want to screw it up.

would notepad, in startnet.cmd, look like this?

wpeinit
diskpart -s diskprep.s
imagex /apply somefile(my created wim).wim 1 C:\
exit

SCCM Engineer

Commented:
Yes, you might want to leave off exit as you want to see if the first lines execute.  If you put in exit on the first go and one of the commands fail, you won't be able to read the screen fast enough before it reboots

Commented:
This is what I put in the startnet.cmd file

wpeinit
diskpart -s diskprep.s
imagex /apply miniimage.wim 1 C:\

But it doesn't do anything but go back to the x: prompt

it boots to x:\windows\system32>wpeinit

waits a bit

then x:\windows\system32>

Do I need to config it to boot to the D: drive/USB?

Not sure what i might be doing wrong

I mount the boot.wim, config the startnet.cmd file, save it, unmount and commit, then copy
all the files in the iso folder to my usb
SCCM Engineer

Commented:
You would probably need to do this:
diskpart -s diskprep.s
D:\yourfolder\imagex /appy miniimage.wim 1 C:\ or add imagex to your WinPE image (Specifically, the system32 folder)

Commented:
this is odd, but perhaps this is causing my problem.

When I look at the USB which I was successfully able to apply and image the test machine, there is no "mount" folder. I understand that the folder is blank until you actually mount the boot.wim, but shouldn't there still be a folder in there? Or does it change once you place an actual image on the USB?

This is what i show on that USB at the root:

boot
EFI
sources
bootmgr
gimagex
imagex
miniimage.wim

and this is the USB from which I successfully applied, outside of manually formatting and partitioning the drive, an unattended install. The only other problem was finishing at the Admin prompt, instead of either OOBE, the desktop, or a User logon
SCCM Engineer

Commented:
If you boot from USB, the ISO is placed into memory, it is never mounted in any directory.

Commented:
so when I plug the USB back into the technician machine, is there anyway of editing that startnet file that is supposedly on the USB?

I have a feeling that when I'm mounting the boot.wim file, that I'm mounting the wrong one

After being successful, I wanted to be able to now format and partition, unattended, before the image.wim gets applied

I've used this path, via the CHM:

Dism /Mount-Wim /WimFile:c:\winpe_x86\ISO\sources\boot.wim /index:1 /MountDir:c:\winpe_x86\mount

but and then xcopying back to the USB.

However, I believe that that mount is not the correct one.
SCCM Engineer

Commented:
If you've correctly mounted and modified the right WIM, you should be able to open notepad within PE and look at startnet.  If it's not correct, you know that you have not mounted the right WIM or have not commited it back

Commented:
That's what I thought. It seemed that I was mounting the wrong boot.wim, going off the original instructions I found in the CHM. Obviously, if I'm working with the "working" boot.wim, that's the one I should be editing, and I'll need to change my path. Would that be safe to assume?

Commented:
Ugh, now my boss declared me the office PE expert, and gave me a project for multiple images to be finished in 1 hr. Got it done! But if I could only get this scripting knocked out. I believe that I'm just mounting the wrong boot.wim.

Commented:
Now the other little PE project has become a possible massive product launch. Guess its good the I'm only somewhat knowledgeable regarding PE, but much more so than my boss. lol

From the additional reading I've done, I need to get the Windows-Sys32-startnet folder mounted, and throw that script in there.

I'm hoping it works, as it would solve both of my PE projects.
SCCM Engineer

Commented:
I looked at the instructions from my WinPE documentation and this is what I do:
To update the drivers in WinPE, first mount the wim:

Dism /Mount-WIM /WimFile:c:\winpe7\winpe.wim /index:1 /MountDir:c:\winpe7\mount

To unmount: make sure you are not in the mount directory (this can take a while):

dism /unmount-wim /Mountdir:c:\winpe7\mount /commit

Copy the WIM as boot.wim to C:\winpe7\iso\sources (yes, you need to rename it boot.wim, otherwise it won’t work)

To convert the WIM to an ISO, run:

oscdimg –n –h –bC:\winpe7\etfsboot.com C:\winpe7\iso C:\winpe7\winpe.iso

Commented:
I've figured out how to mount the CORRECT file, its about time for me to figure it out. Anywho, new problem

I've got to edit startnet.cmd, so it will format quick, and partition the hard drive, before install the program off USB.

the program the other company has starts off with

@echo off

what would I put before this so that I partition and format the drive, but also allow their program to run afterwards?

the USB/UFD is D:

the HD is C:

My boss said just put:

diskpart
list disk
select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign

and then the

@echo off stuff is supposed to run, but when  I run this, it goes to

x:\windows\system32\diskpart
Microsoft Diskpart Ver 6.0
on computer: XXXXXXXX

Diskpart>

and stops

any ideas?

Commented:
Got it to work

put

diskpart /s file.txt    in startnet.cmd

created a seperate text file in the same directory

Next question..How do I add additional applications..Boss said preferably ones that are .msi

SCCM Engineer

Commented:
Hmm, that's weird.  I assume disk 1 is really the hard drive in the laptop and not disk 0?  Usually Disk 0 is the hard drive and why it is FAT32?   If it works, I guess I wouldn't worry.
For MSI apps, you would kick those off in the GuiRunOnce section of sysprep.inf, such as
Command1=msiexec somefile.msi /quiet /norestart
Command2=msiexec someotherfile.msi /quiet /norestart
etc
SCCM Engineer

Commented:
msiexec /i somefile.msi /quiet /norestart

Commented:
I'm sorry if I asked this before, but how would I open the sysprep,inf to enter that info? Would I need to start a new sysprep? or is there a file I can open after I mount the wim?

Commented:
I found a sysprep folder in windows/sys 32 in my mount, but no inf file in there. I'm sure that you've covered it somewhere, but my head is spinning from having to rush out another PE project.

Commented:
One more thing. Is the wpeinit file necessary in the startnet folder?
SCCM Engineer

Commented:
You can mount the WIM and copy it out to edit it.  You can sysprep and not take an image to test your settings.
SCCM Engineer

Commented:
I would leave it alone.  I think it is solely there to start network services, but don't fix what isn't broken.

Commented:
"You would probably need to do this:
diskpart -s diskprep.s
D:\yourfolder\imagex /appy miniimage.wim 1 C:\ or add imagex to your WinPE image (Specifically, the system32 folder)"

Would I need to point the dispart to a seperate file, such as a text file, with the rest of the commands?

Commented:
Ok cool, now I got it to partition and format the drive, now I need to get it to autostart the apply and install...then I'll worry about adding apps..Almost where I need to be

What a pain the arse this has been, however probably no more so than you taking all my questions from all different directions.

Thanks again

what exactly will dispart -s and diskprep.s do? and do I add my path just under it, as you laid it our in your instructions?
SCCM Engineer

Commented:
diskpart -s whatever.txt just runs whatever diskpart commands are in the text file.  The weird thing is that everyone seems to use diskpart /s somefile, but mine is actually diskpart -s diskprep.s.   If /s works, just use that.
Whatever you type in diskpart to delete, format and create partitions, that's what you would put in the script.
I still don't understand your diskpart script.   You should always use NTFS for the file system, unless you are formatting USB flash drive.  Also, assign cannot be used by itself, you need to say assign letter=c when you have a partition selected.
Rather than re-invent the wheel and over over the nuances of diskpart, take a break and read through http://forums.techarena.in/guides-tutorials/1172499.htm

Commented:
I can change it to NTFS. The whole desktop, WAIK, imaging thing, is all new to me.

The formatting and partitioning worked fine, although I'll change the fs when I get back to work tomorrow, as I forgot to bring home powercords in my haste to get home. Rough day, but not because of this project.

Its been a real pain in the arse. Monday, he seemed pretty happy with my progress over the weekend, and said that the project probably wouldn't roll out till late 1Q at the earliest, and then by Wed, he said that he was taking the project away from me. I was like WTF.

Anywho, I'll add your diskpart stuff. I forgot a powercord for the netbooks, so I can't work on it tongiht, but will have to push a bit in the am before my 930 meeting with the boss. I'm just gonna give him what I've got.

I'm able to get the partition and format to work, but still have to manually apply the wim. I'm sure that you covered that, but my head has been spinning lately with the the stuff thrown at me at work.
SCCM Engineer

Commented:

http://grandstreamdreams.blogspot.com/2010/06/slick-script-solution-for-imagex-cd.html
Those scripts are more complicated then they need to be, but you get the idea.
If you look through his code, he's using the same stuff we are here:

D:\tools\imagex.exe /apply D:\images\LatE6400_04-10.wim 1 C:\
Working in IT requires expertimentation.  None of my batch or VBScript files work on the first try.  Expect to fail and fail a lot: that's part of the learning process.
No one at my company told me to stop using floppy disks or Norton Ghost.  I just got sick and tired of the way it was setup and decided to research a better solution.  This is what I came up for my company since I'm in charge of desktop support.
I think you are off to a strong start getting this to work.

Commented:
I really appreciate your help with this, as well as your patience.

This has been a good learning experience, although very frustrating at the same time. I've had several "eureka" moments, where all the information finally makes sense. While I joined for the free trial, I expect to stay as a paying member, as this site, and you specifically, have provided much greater information than I have ever received from any other site, or person, on the Internet.

While its not 100% complete, I've come a long way, and with a bit more time, I would have completed this, as well as had the confidence to complete it under other various scenarios and OSs.

If anything, I'm going to grab some USBs, and make a bunch of PEs for my own use, as well as for working on friends/relatives PCs.

Thanks aleinss

Commented:
Last second I was able to figure out the path to get the wim to apply after part/format.. So that was a nice way to finish it up for me. It all seems so simple now that I've gone through messing it up a billion times and over thinking everything.

Commented:
One more thing.

How would I add a pause, for say 5 seconds, and or a "are you sure you want to do this YES or NO" to a script?

I have that script which formats and partitions the drive, running off of file.txt.

Is there a way to add a delay, or a confirmation which would require the person running the install to manually confirm that they want to format and partition the drive?

I'm going to try and learn some scripting and writing batch files this weekend, as the boss loves them and feels there are essential to what they do here, but would like to quickly edit my file.txt on my PE, in the event someone takes my USB, and inadvertently plugs it in and runs it.
SCCM Engineer

Commented:
Take a look at my blog entry above...there's a simple menu created in a batch file that I use to drive everything.
To sleep x amount of seconds, you can use ping -n x 127.0.0.1.  The time to send 1 packet is close enough to 1 second.

Commented:
sounds good. thanks as always.

I'm going to give myself a crash course on scripting. Never had to use it, screwed one up..actually got it right, but what I was doing didn't require a part/format script (not our project), and it wasn't good for me, but no one died, just a mess up.

But the boss loves batching, so I've got to learn it.

Commented:
Here's a question my boss had for me.

Why is it, where you're applying your *.wim or whatever, you have to include a number after it, in this care the number 1? Even though there's a unique filename before it?
SCCM Engineer

Commented:
You can include multiple WIMs in 1 WIM, therefore you need to index which one you want.  If you always do one image to one WIM, the number is always 1.

Commented:
One more thing.

After my USB formatted and partitioned the drive, and applied the image, it ended at the x: prompt

I then remove the usb, and type "exit", and reboot

is there a way to create a message instructing the user to remove the USB stick and either manually reboot, or hit a key to reboot, otherwise it books back to the USB, starting the process once again, or even better, allowing it to continue or reboot with the USB in, but have the installation continue.

Commented:
I've added a pause to my starnet file, but is there a way to add a message instructing the user that they are about to format, partition, and install an image to their machine?
SCCM Engineer

Commented:
I'm pulling the release level on this question.  Do feel free to open a new question if you need help with your scripting issues.

Commented:
sounds good, and makes sense.

Do more with