Solved

Sysprep on Windows XP - clean up non-existent devices

Posted on 2004-05-03
8
4,821 Views
Last Modified: 2012-08-13
Hi,

My goal is to have a ghost image that can be restored to a PC with different hardware. Before bothering to test on *different* hardware, I tested sysprep with the *same* hardware first:

(1) used -bmsd to build the mass storage controller sections in sysprep.inf
(2) run sysprep -mini -activated -reboot
(3) Let the mini setup finish upon reboot

The system did come up successfully, but I noticed the boot process was *much* slower. After I logged on, I checked the "Non PnP drivers" in device manager. There were many orphan devices which were not present before sysprep - e.g.  abp480n5, adpu160m (God knows what they are).

In fact, before sysprep there were 32 non-PNP devices; afterwards there were 75 of them. Hence there ware 75-32 = 43 orphans.

I checked the doc and there was a -clean switch that "cleans up critical non-existent devices". I run sysprep with this switch but it appeared to do nothing. These orphans were still there.

My question: how do I remove these orphan devices? (manual one-by-one removal from device manager is not acceptable).

Thanks.
0
Comment
Question by:Gating
8 Comments
 
LVL 21

Expert Comment

by:briancassin
ID: 10975312
This should explain and solve your problem

http://support.microsoft.com/?id=837691

Hardware devices not installed in Sysprep image

SYMPTOMS
When you use the Microsoft System Preparation tool (Sysprep) to deploy a Sysprep image of Microsoft Windows XP to a computer, some devices may appear in Device Manager as not installed even when the driver for the device exists in the path that is set by the oempnpdriverspath entry in the Sysprep.inf.

If you double-click on a device in Device Manager, you receive the following error message in the Device status box on the General tab:

The drivers for this device are not installed. (Code 28)
Additionally, a yellow exclamation mark appears next to the device when you view it in Device Manager.
CAUSE
This problem occurs when you create a Sysprep image on a computer and then deploy that image to a computer that has the same type of hardware. Any devices that do not have their drivers installed will remain in this state after the deployment of the Sysprep image. The minisetup program that is used by Sysprep does not perform a full Plug and Play re-enumeration of all devices.
WORKAROUND
Before you run Sysprep to prepare a computer for duplication, remove any devices in device manager that are set to Code 28. To remove these devices, follow these steps:
Click Start, and then click Control Panel.
Double-click Administrative Tools.
Double-click Computer Management.
Click Device Manager.
Locate any device that has a yellow exclamation mark next to it.
Verify that the device status for the device has the error message that is listed in the "Symptoms" section of this article. To do so:
Right-click the device icon.
Click Properties.
The Device status box lists the error message:

The drivers for this device are not installed. (Code 28)
Right-click the device icon, click Uninstall and then click OK.
Repeat steps 5 through 7 for each device that has the Code 28 error message.
0
 

Author Comment

by:Gating
ID: 10976127
My situation is entirely different from the one suggested by braincassin.

His situation: After sysprep, some devices have "code 28" (yellow exclamation mark) in device manager.

My situation: After sysprep, no devices had "code 28" error - everything is fine. The only problem was I got *EXTRA* Non plug-and-play devices installed. I saw these devices by choosing "Show Hidden Devices" in the device manager's menu.

At the risk of being too involved, probably I should supply more details:

1. Before sysprep, my Non PNP section in the device manager was very lean: it only contained "virtual" devices. By "virtual" I mean devices that did not correspond to real hardware. e.g. TCP/IP protocol driver, "sygate for NT, wg3n" (installed by sygate firewall), etc.

2. After sysprep, my Non PNP section got extra devices. Most of them corresponded to REAL hardware. For example,  ALI AGP Bus filter, AHA154x (probably some kind of SCSI controller), etc. THey did not exist before sysprep was used.

3. I am confused because the device manager reported these devices were "working properly". I was very sure they were physically not present in my PC. How could they "work properly"?

4. After I tediously removed them one by one from device manager, they came back on the next reboot!

5. My boot time were also increased by 30 seconds. I strongly suspected these extra devices were the cause.

Hope these help.
0
 
LVL 7

Expert Comment

by:rhrowson
ID: 10976408
I have been down this path, and the decision we ,mmadfe was to leave all the drivers as it made the build esaier to support remotely, and if a driver gets corrupted, the driver files are already in place. XP eventually learns to ignore unneeded devices (which is why it boots quicker than W2K)
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:Gating
ID: 10976656
Hi rhrowson. I think having a copy of driver *files* in my hard disk is one thing; but having *devices* showing up in the device manager is another, especially when it adversely affects the boot time.

You see, having these driver *files* does not affect my boot time. However, having a *device* in device manager *DOES*, because the drivers must be loaded. Moreover, these are orphan devices (as I said before, my PC did not have "AHA154x", "ALI AGP BUS filter etc", "cpqarray", etc), therefore the boot process spent a lot of time in loading drivers and wait for timeout. *THIS* is the problem.
0
 
LVL 7

Expert Comment

by:rhrowson
ID: 10976920
I'll have a look at my master image after deployment and see what it does. I have never noticed this behaviour, but I may have missed it.
0
 

Author Comment

by:Gating
ID: 10983190
OK I will answer my own question. I found the answer by experiments and reading the docs.

"sysprep -bmsd" populates sysprep.inf with entries, each of which corresponds to a mass storage controller found in the Machine.inf, Scsi.inf, Pnpscsi.inf, and Mshdc.inf. After that, when you use sysprep normally (without -bmsd switch), all such devices will be created in device manager, so that the next reboot will load *all* such drivers.

In theory, when this next reboot finishes, the "unused" drivers should be automatically cleanup. In practice, they are not. This is why I saw the orphan devices. To clear them, I have to use "sysprep -clean". The best way is to create C:\sysprep\i386\$OEM$ folder. Put there a cmdlines.txt file that reads

[Commands]
"C:\sysprep\sysprep -clean"

Then in the sysprep.inf file, put the line in the [Unattended] section:
InstallFilesPath=C:\sysprep\i386

This will make sure the orphan files to deleted.

One thing I discovered was that sysprep appended a section named "[SysprepCleanup]" to my sysprep.inf. This section contained all information about what devices should be removed. Provided this section was intact, "sysprep -clean" will do the cleanup for me.

But the tricky part is that C:\sysprep will be automatically deleted after completion. So when I login, I will see no c:\sysprep folder. In particular, I see no sysprep.inf file, so the[SysprepCleanup] section is not there, and "sysprep -clean" has no effect. I must cleanup *while* the sysprep.inf file is still there. This is why I choose to put the command in cmdlines.txt file.

As for the slow boot time, it turned out it was unrelated to these orphan devices. My system had Intel 845 chipset and I was using Intel Application Accelerator. Somehow the sysprep process messed up with the drivers installed by IAA, without warnings shown in the device manager.  I reinstalled it and the boot time was normal again. As to why this occurred, I am still investigating. However I now consider my questions answered by myself.

Thanks for your help guys.


0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 10983340
User resolved; closed, 50 points refunded.

Netminder
Site Admin
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now