osborned_rcc Posted August 25, 2005 Posted August 25, 2005 (edited) What I'm trying to do is to minimize coding time, by running SetupCopyOEMInf.exe AFTER setup, then somehow forcing PnP enumeration again. This is because if I run SetupCopyOEMInf.exe after install, the drivers for the "unknown" devices are there, they're just not loaded until I run the Update Hardware Wizard. Is there a program out there that runs auto-update on all devices, or re-runs PnP discovery? The closest thing I've found out there might be the sysprep tool, using the -pnp argument, but it seems it's really a tool for imaging rather than a general tool, and I'm unsure what it might do if I call it in my cleanup file. The -pnp argument forces PnP discovery after a reboot, but then I don't know what else it's supposed to do.My idea here is that I don't bother using Winnt.sif to find drivers, keep my drivers on CD, run SetupCopyOEMInf.exe against the drivers on the CD, then force PnP discovery to setup the new drivers. After this, the cleanup.cmd file performs a reboot and voila, all drivers are installed. I'm not worried about leaving the drivers on the hard drive as I'm setting up stock Dell PC's for labs and offices.Any other ideas? Edited August 25, 2005 by osborned_rcc
osborned_rcc Posted August 26, 2005 Author Posted August 26, 2005 Of course, a few minutes after I post this, I find a hopeful thread:http://www.msfn.org/board/index.php?showtopic=52741
computastar Posted August 26, 2005 Posted August 26, 2005 Hi osborned_rcc,I've been following the forum for a while now, and got some very useful information from it, so its about time I gave something back.I to use a similar method to the SetupCopyOEMInf.exe way, so like yourself was looking for a way to autorun rescan hardware. After much investigating I discovered the way that sysprep calls -pnp or the UpdateInstalledDriver key in Sysprep.inf. Sysprep uses many api calls that are in syssetup.dll, one of these call is UpdatePnpDeviceDrivers, so you can call this from a command line as shown below:RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriversYou could use this in batch file or vbscript. You need to be careful with the case. It has to be as above or it will fail.Hope the helps.Computastar
schalti Posted August 26, 2005 Posted August 26, 2005 (edited) Hi osborned_rcc,I've been following the forum for a while now, and got some very useful information from it, so its about time I gave something back.I to use a similar method to the SetupCopyOEMInf.exe way, so like yourself was looking for a way to autorun rescan hardware. After much investigating I discovered the way that sysprep calls -pnp or the UpdateInstalledDriver key in Sysprep.inf. Sysprep uses many api calls that are in syssetup.dll, one of these call is UpdatePnpDeviceDrivers, so you can call this from a command line as shown below:RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriversYou could use this in batch file or vbscript. You need to be careful with the case. It has to be as above or it will fail.Thanks for the tip.I think "devcon.exe /rescan" should also do the job. Edited August 26, 2005 by schalti
Bilou_Gateux Posted August 27, 2005 Posted August 27, 2005 Hi osborned_rcc,I've been following the forum for a while now, and got some very useful information from it, so its about time I gave something back.I to use a similar method to the SetupCopyOEMInf.exe way, so like yourself was looking for a way to autorun rescan hardware. After much investigating I discovered the way that sysprep calls -pnp or the UpdateInstalledDriver key in Sysprep.inf. Sysprep uses many api calls that are in syssetup.dll, one of these call is UpdatePnpDeviceDrivers, so you can call this from a command line as shown below:RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriversYou could use this in batch file or vbscript. You need to be careful with the case. It has to be as above or it will fail.Hope the helps.Computastar <{POST_SNAPBACK}>Welcome to MSFN forums. I see it's your first post here and i would like to thanks you joining us for posting this info. Long time ago, i was googling to find an alternative to DEVCON command line (no GUI) or devmgmt.msc (not really unattended ) and never find the answer. Now i've got one answer i can use for some of my batch scripts as linked by osborned_rcc.
osborned_rcc Posted August 27, 2005 Author Posted August 27, 2005 (edited) Thanks for the tip.I think "devcon.exe /rescan" should also do the job. <{POST_SNAPBACK}>I'm not sure about that, as taking a look at the explanation for that switch says it simply runs "Scan for New Hardware", and doing that manually in Device Manager after integrating drivers never worked. What Bilou's code seems to do is to force Device Manager to force each unknown device to be rescanned. "Scan for New Hardware" shouldn't do anything, as the hardware's already been FOUND, it just hadn't been installed. I've tried Bilou's code and it works fine. I simply put it in my cleanup file and don't worry about messing with AutoIt scripts in a DetachedProgram or anything, it's just taken care of. The setup process is a bit slower, but it works, so I don't care if it's not pretty. Bilou's code presents a great simple way to dynamically integrate drivers. Edited August 27, 2005 by osborned_rcc
Bilou_Gateux Posted August 27, 2005 Posted August 27, 2005 (edited) @shaltiI think osborned_rcc is right.DEVCON RESCAN works in my batch file because i first delete infos about device in registry with:DEVCON REMOVEThis command is equivalent to devmgmt.msc (Device Manager), click on the device, right click, UninstallDEVCON RESCANScan for hardware changes works for new devices not already detected.command1RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriversis same as command2DEVCON updateni <inf> <hwid>This command is equivalent to devmgmt.msc (Device Manager), click on the device, right click, Update Drivers...command1 updates all devices instead of only the one specified with hwidinfs files have to be integrated first with Pyron's SetupCopyOEMInf.execommand2 uses specified inf file and update only specified hwid Edited August 27, 2005 by Bilou_Gateux
LeveL Posted May 14, 2007 Posted May 14, 2007 Sysprep uses many api calls that are in syssetup.dll, one of these call is UpdatePnpDeviceDrivers, so you can call this from a command line as shown below:RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriversYou could use this in batch file or vbscript. You need to be careful with the case. It has to be as above or it will fail.Thanks for this, but where does Windows look for the drivers if you run this command?Is there any way to append a path to the drivers to this command?Example:RunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers "%SystemDrive%\driver_temp\"
p4ntb0y Posted May 14, 2007 Posted May 14, 2007 forgive me for being a bit thick but I am I right in thinking that....if windows starts up and it knows the device name but does not know the path to the Device driver then all you need to do is run -pnp?I have a situation were most of my drivers load on sysprep but some pop up asking for the location I then click find automacticallly and then it loads fine sometimes I have to click continue anyways when no cat file exists.if this is totally unrelated I start a different post.
IcemanND Posted May 14, 2007 Posted May 14, 2007 Thanks for this, but where does Windows look for the drivers if you run this command?It will use the path listing from the registry in HKLM\software\microsoft\currentversion\devicepathby default this is set to only look ing %systemroot%\inf, but if you have added paths via winnt.sif or sysprep.inf, or other answer files or methods you may have more.@pantboy - how are you adding the paths to your drivers? And have you turned off the driver signing policy?Running sysprep -pnp will still reseal the machine, if all you need to do is have windows research for drivers thenRunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers should do the trick.or check this topic out:http://www.msfn.org/board/Drivers_CD_Path_...09.html&hl=
p4ntb0y Posted May 16, 2007 Posted May 16, 2007 @icemanI have tried via Unatted and sysprep which I know just updates the reg device path as you mentioned.Driver signing is off via the sysprep.infI have taken out oempnpdrvierspath in sysprep as I now use sysprep driver scanning (top tool)This does the following....flush data to disksdelets old driver cachescreates driver paths for devicepath reg valueclose smb connectionsTerminate'sunneeded processesStop's unnessary servicesRemove's cached OEM driversclear event logsflush data to disksand then finallystart sysprep -reseal -mini -quietI dont use -pnp as I was told that this adds additional time to boot.As I do not fully inderstand the -pnp and the way these drivers behave I Thought I post in this topic, I dont however want to to be flamed to death for hijacking someone's post if its not related I start a new one.Like I said before all my hardware works fine except the NC6400 (its a laptop by the way) its knows the name of the device and the reg value is correct, driversiging is set to ignore however up pops the prompt box I click find automacitally and then it loads up fine. Some driver's require the "continue anyway" click and others don't (I am I right in thinking that those that require "continue anyway" dont have a cat file)Its a bit strange as I dont fully understand the whole in depth preocess
IcemanND Posted May 16, 2007 Posted May 16, 2007 if you are already running sysprerp try adding the -pnp switch. it only adds about a minute to the startup time. Also have you added 'UpdateInstalledDrivers=Yes to the Unattended section of your sysprep.inf? That is needed for installing unsigned drivers in my experience.
p4ntb0y Posted May 16, 2007 Posted May 16, 2007 @icemanYeah I have the updatedrivers set to yesI will add the -pnp into my sysprep and test it.I got 25 different models running just fine. I need to sort this out as a temp solution untill I have finished the BDD 2005 and SMS OSD FP and then all i do for drivers is a wmi call to the model from the bios and then update the drivers in my wim automatically works nice but maybe can work better with some of the great tools in this forum.
kickarse Posted May 23, 2007 Posted May 23, 2007 (edited) Try this out guys...Using WatchDriverSigningPolicy.exe and Vernalex Sysprep Driver Scanner I've been able to come up with a batch script to do something similar to your program. Make sure that they are all in the same directory. I used c:\d for the drivers locations (bashrats driverpacks).Basically it turn off Driver Signing using Pyrons method, then imports drivers into the registry, then start Device Manager so you can see what's happening, then it starts the install of the devices. Once install finishes it closes out WatchDriverSigningPolicy and the Device Manager (mmc.exe).@ECHO OFFECHO Setting Driver Signing Policy to OFFSTART WatchDriverSigningPolicy.exeECHO Importing Drivers to RegistrySTART /WAIT spdrvscn /p c:\D /e inf /d %windir%\inf /a /s /qECHO Starting Driver ManagerSTART devmgmt.mscECHO Starting Install of HardwareSTART /WAIT RunDll32.exe Syssetup.dll,UpdatePnpDeviceDriverstaskkill /f /im WatchDriverSigningPolicy.exetaskkill /f /im mmc.exe Edited May 23, 2007 by kickarse
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now