imz Posted April 7, 2006 Posted April 7, 2006 Does anyone know where i can find the system modal information from msinfo32 whilst i am doing my driver installs.This would be helpful as I can then make 1 cd for a whole variaty of computers. The script would query the system modal and then would install the necesary drivers depending on what modal it is...Any help would be much appreciated.Thanks for your time.
jyrwin Posted April 7, 2006 Posted April 7, 2006 (edited) Mayby many way to do. Example with kixtart (KixTart 4.51).Just copy lines and save it with name somename.kix and call like: kix32.exe somename.kixEdit script with your models, pls look at "select case... endselect"Break OnFunction WMIQuery($sWhat, $sFrom, Optional $sComputer, Optional $sWhere, Optional $x, Optional $root) Dim $sQuery, $objEnum, $sValue, $sItem, $TMP If NOT $sComputer $sComputer=@WKSTA EndIf If InStr($sComputer,'\') $sComputer=Right($sComputer,InStrRev($sComputer,'\')) EndIf If NOT $root $root="\root\cimv2" EndIf $sQuery = "Select " + $sWhat + " From "+ $sFrom If $sWhere AND $x $sQuery = $sQuery+" Where "+$sWhere+" = '"+$x+"'" EndIf $SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+$sComputer+$root) If @ERROR Exit Val("&"+Right(DecToHex(@ERROR),4)) Return EndIf $objEnum = $SystemSet.ExecQuery($sQuery) If @ERROR Exit Val("&"+Right(DecToHex(@ERROR),4)) Return EndIf For Each $objInstance In $objEnum If $objInstance $=Execute("$$sValue = $$objInstance.$sWhat") If VarType($sValue) & 8192 For Each $sItem In $sValue $tmp=$tmp+'|'+Trim($sItem) Next Else $tmp=$tmp+'|'+Trim($svalue) EndIf EndIf Next $WMIQuery = Split(SubStr($tmp,2),'|') Exit Val("&"+Right(DecToHex(@ERROR),4))EndFunction$SerialNumber = WMIQuery("IdentifyingNumber","Win32_ComputerSystemProduct","@wksta","WQL","")[0]$Manufacturer = WMIQuery("Vendor","Win32_ComputerSystemProduct","@wksta","WQL","")[0]$Model = WMIQuery("Name","Win32_ComputerSystemProduct","@wksta","WQL","")[0]$BIOSVersion = WMIQuery("SMBIOSBIOSVersion","Win32_Bios","@wksta","WQL","")[0]$BVersion = WMIQuery("Version","Win32_Bios","@wksta","WQL","")[0]If $BVersion = $BIOSVersion $BVersion = ""EndIf? "$Model"Sleep 3Select Case $Model = "Model 1" Shell "Model_1.cmd" Case $Model = "Model 2" Shell "Model_2.cmd" Case 1 ; this is a nice way to provide a default CASE ; if all other CASEs fail, this one will always be run EndSelect Edited April 7, 2006 by jyrwin
cancerface Posted April 7, 2006 Posted April 7, 2006 There's a handy tool called devcon.exe which would help in the scenario that you described. However you will have to play with your settings in order to get it to look for specific things in your system.For example, the following gives me the model of my Silicon Image controller:FOR /F "tokens=4 delims=_,&" %i IN ('devcon.exe hwids PCI\VEN_1095 ^| FINDSTR /c:"SUBSYS"') DO SET controller=%iin my system the above line will set %controller% to 3114 ...Similar results you can get with WMI using wmic.exe.I would start with devcon.exe in order to identify what hardware I have installed and then I would script the installation of drivers using simple querries like the one above. I am sure there's quite a few posts around where people have used VB to achieve the same Hope this helps ...CFPS Try this:devcon.exe hwids * >>MyDevices.txtin order to get a file with all the devices that exist in your system.
Bezalel Posted April 7, 2006 Posted April 7, 2006 Why don't you put all your drivers on the CD and let Setup detect what devices you have installed. There are 2 problems with installing drivers based on the computer model. The first issue (which is two issues in itself) is you need to create a database of what each model contains and that can alway change when hardware is upgraded. The second isuue id that WMI is not fully fuctional during setup so you won't be able to see the model.Take a look at http://www.driverpacks.net/Projects/DriverPacks/
Djé Posted April 7, 2006 Posted April 7, 2006 (edited) Bezalel, I must agree with you for the drivers for which you can install everything with the inf file.But many laptops for example, come with a set of 'Drivers and Utilities', some of them not totally useless and some of them requirering to be set up using an exe installer (no inf provided or not every feature installed by the inf). The trouble comes when the formers and the laters are the same.Then, since each set has to be installed on its computer, you would benefit from knowing which computer you're installing on. Actually, I was waiting for your Oembios files thing to tweak it in that direction. Beside, on laptop, you don't upgrade so much the hardware, and making the 'database' is relatively straight forward.Now, all my computers are from different manufacturers. Do you know if WMI is functional *enough* at T12 to be queried by something like the above script, so I can at least find out that piece of info, which in turn will be enough to decide on what files to copy/CD-key to use/Apps to install?edits: bad english to somewhat better english Edited April 7, 2006 by Djé
Bezalel Posted April 7, 2006 Posted April 7, 2006 WMI is not functional enough at T-12 (that is proving to be the biggest hurdle to my oembios issue). You can run such a script from GuiRunOnce. I'm using a simular technique and running my script to find the manufacturer's name then converting it to a hex sting and looking for (or in your case launching) files with the hex string as its name.
cancerface Posted April 7, 2006 Posted April 7, 2006 (edited) I am running devcon scripts at GuiRunOnce in order to get drivers installed (that were not installed using the BTS packs, or that need further deployment like control panels etc).CF[Edit]I can confirm that devcon.exe can run at T12 without limited functionality, at least on a virtual PC and I do not see a reason why it would not be functional on a real PC ... Edited April 7, 2006 by cancerface
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now