SYSPREP : How to build a list of just the PnPIDs I need for [SysprepMassStorage]

A

alistg

I'm familiar with use of "-bmsd" , "BuildMassStorageSection=Yes" and the
[SysprepMassStorage] section.

Now I want to include JUST the PnP IDs for devices that I actually NEED
below [SysprepMassStorage] in order to minimise start-up times.





Deploy.chm says:

"To identify the potential mass-storage controllers on destination computers

- Generate a list of each of the hardware IDs for each of the mass-storage
controllers that may be on the destination computers

- Compare the list in step 1 with the hardware IDs listed in the .INF files
to determine which references are needed".



I want to automate this and run a script against a representative example of
each machine type I have within the environment, find the IDs for the boot
devices - I can then scan machine.inf, scsi.inf, pnpscsi,inf and mshdc.inf
(or maybe - more ideally - find the .inf used from the machine I scanned -
this would then cover non-natively supported devices !) and add the relevant
section to [SysprepMassStorage].





Questions:

- How do I identify JUST the boot device ? so as to avoid superfluous
drivers ? (- maybe use of ClassID ?, or looking in CriticalDeviceDatabase ?)



- Any suggestions on how to scan for this info ? (e.g. VBscript to check
registry - if so precisely where etc)

I've tried stuff like WMI and Select * from Win32_SystemDriver - within this
I can then look at StartMode, however there are still quite a lot of devices
that start at boot (all I want is the mass storage driver !).





(Rather than simply providing the -bmsd stuff and reccomending manual
"pruning", it would have been cool if MS provided a script that could run on
machines in an environment in order to build up a list of entries that could
be added to [SysprepMassStorage]).
 
G

George S. Ellis

I don't know a quick answer, but you could use the bmsd section as a text
file, parse the PnpEntity value against it, and then write/append a new file
to store what you have. This is hacked up really fast; more work is
required, but this will work as a starting point. Of course, there may be
an easier way, I just don't know it.
==============
Set tempSet =
GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select *
from Win32_PnPEntity")
if tempset.count=0 then
Wscript.Quit
End If

For each DeviceID in tempset
' str compare DeviceID.DeviceID against values in a file - you may need to
format the bmsd results before you proceed.

sFilePath = "A:\mybmsd.txt"
Set TextStream = fso.OpenTextFile(sFilePath, 1)
Do While Not TextStream.AtEndOfStream
sStr = TextStream.ReadLine
nRtn = StrComp(DeviceID.DeviceID, sStr)
if nRtn = 0 Then
'call a file write routine
End If
Loop
TextStream.Close
Next
==========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top