Bilou_Gateux Posted August 6, 2005 Posted August 6, 2005 (edited) Here a small batch i use to install the devices unknown from Windows at the end of install.May be someone will find it of some interest...Required tools: Pyron's SetupCopyOEMInf.exe Microsoft's Devcon.exe@ECHO OFFSETLOCALset DriverPack=%SystemDrive%\PnPDrvrs::// Define which class to install/updateset class=Unknown::// Path to Pyron's SetupCopyOEMInf.exe toolset SetupCopyOEMInf=.\bin\CopyINFs.exe::// Path to Device Console toolset DevCon=.\bin\devcon.exe%SetupCopyOEMInf% %DriverPack%::// goto :%class%:Unknownset command=remove::// Find all Devices, with specified setup %class% name, and start %command% subroutine for each oneFOR /F "tokens=1* delims=: " %%A IN ('%DevCon% FindAll ^=%class% ^| FIND ":"') DO (SET ID="%%A")&(SET DEVICE=%%B)&(SET HWID=%ID:~0,22%")&(CALL :%command%)::// run single %command%set command=rescangoto :%command%:remove::// Remove devices that match the specific hardware or instance IDecho Device: %device%%DevCon% %command% %HWID%:rescan::// Tell plug&play to scan for new hardware%DevCon% %command%to help understanding the batch script, see output for a Video Controller:command:DEVCON FindAll =Unknown | FIND ":"output: %%a : %%bPCI\VEN_8086&DEV_2572&SUBSYS_101B1734&REV_02\3&61AAA01&0&10 : Video Controllerset variables:HWID="PCI\VEN_8086&DEV_2572"DEVICE=Video ControllerRemove device that match the specific hardware or instance ID:devcon remove "PCI\VEN_8086&DEV_2572"Tell plug&play to scan for new hardware:devcon rescanI don't install unknown devices during UA install using methods described in this forum for one reason. I use the same Hard Drive with the installed Windows in two box with different hardware. Solution 7: Create a new Hardware Profile before shutdown Windows.Question: does anybody know how to create a new Hardware Profile with a command line?standard GUI method:How To Create Hardware Profiles on Windows-Based Mobile Computers Edited September 17, 2005 by Bilou_Gateux
Bilou_Gateux Posted August 16, 2005 Author Posted August 16, 2005 (edited) Script used to update display driver configured with default OS drivers.; T2100222.inf;; Installation inf for the Trident series of graphics adapters.; © Copyright 2003, Trident Microsystems, Inc. All rights reserved.;[Version]Signature="$WINDOWS NT$"Provider=%trident%ClassGUID={4D36E968-E325-11CE-BFC1-08002BE10318}Class=DisplayCatalogFile=tridxp4.catDriverVer=06/03/2003,6.14.01.0006../.. [trident.Mfg]Trident Video Accelerator Cyber-XP4 v6.4823-104.22_2 = tridxp4, PCI\VEN_1023&DEV_2100&SUBSYS_00021179path=%DriverPack%\%Class%\%infdir%\%infname%C:\PnPDrvrs\Display\T2100222\T2100222.infDrivers are compressed using hp38guser Driver Compressor tool.soul DriverInstall.exe tool is used for non digitally signed drivers.command:DEVCON FindAll =Display | findstr /R /I "\\V"output: BUS VEN DEV SUBSYS DEVICEPCI\VEN_1023&DEV_2100&SUBSYS_00021179&REV_91\4&1BFA44D4&0&0008: Standard VGA Graphics Adapter@ECHO OFF:: Check Windows versionIF "%OS%"=="Windows_NT" (SETLOCAL) ELSE (GOTO Syntax)VER | FIND "Windows NT" >NUL && GOTO Syntax:: Check command line argumentsIF NOT "%~1"=="" IF /I NOT "%~1"=="/A" GOTO Syntaxset DriverPack=C:\PnPDrvrs:: Choose between all devices or just the Display classIF /I "%~1"=="/A" (SET class=Unknown) ELSE (SET class=Display):step1echo.%class%call :FindDevecho.%DEVICE%echo.%HWID%CALL :HWID %DriverPack%\%Class% echo.%INF%CALL :Exec updateni %INF% %HWID%:: DoneENDLOCALGOTO End :FindDevFOR /F "tokens=1-3* delims=\: " %%a in ('devcon findall ^=%class% ^| findstr /R /I "\\V"') do (set device="%%d")&( for /f "tokens=*" %%e in ("%%b") do ( for /f "tokens=1-4* delims=&" %%f in ("%%e") do ( set HWID="%%a\%%f&%%g&%%h" )))GOTO:EOF :: :: :: :: :: HWID :: :: :: :: :::HWID PUSHD %1 for %%f in (*.inf) do ( for /f "eol=- tokens=2 delims=," %%i in ('find /i "pci\ven" %%f') do ( for /f "tokens=*" %%j in ("%%i") do ( for /f "tokens=1* delims=_" %%k in ("%%j") do ( if /i "%%k" EQU "PCI\VEN" ( for /f "usebackq tokens=1* delims=; " %%a in ('%%j') do ( if /i "%%a" EQU %HWID% set INF=%cd%\%%f ) ) ) ) ) ) FOR /F %%I IN ('DIR /AD /OGN /B') DO ( CALL :HWID %CD%\%%I ) POPD GOTO:EOF :: :: :: :: :: UPDATENI :: :: :: :: :::Exec::// digitally signed driversecho.devcon %1 %2 %3::// not digitally signed driversdriverinstall %1 %2 %3GOTO:EOF:SyntaxECHO.ECHO Display.cmd Beta releaseECHO Install Display class device drivers, optionally including even unknown onesECHO.ECHO Usage: UNKNOWN [ /A ]ECHO.ECHO Where: /A installs both Display and Unknown class devicesECHO (default is Display class device only)ECHO.ECHO Notes: [1] This batch file requires Microsoft's DEVCON.EXE, available atECHO http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272ECHO.ECHO Written by Bilou GateuxECHO function HWID written by IcemanNDECHO "http://www.msfn.org/board/index.php?showtopic=43413&view=findpost&p=301583"ECHO parts of code by Rob van der WoudeECHO http://www.robvanderwoude.com:EndIF "%OS%"=="Windows_NT" ENDLOCALBatch script will fail if SUBSYS is not defined in device driver inf file. ;; NVIDIA Windows 2000/XP Display INF file; Copyright 1999-2002 NVIDIA Corporation. All Rights Reserved.;[Version]Signature="$Windows NT$"Provider=%NVidia%ClassGUID={4D36E968-E325-11CE-BFC1-08002BE10318}Class=DisplayCatalogFile=NVFS.CATDriverVer = 10/25/2002, 4.1.0.4../..[NVidia.Mfg]%NVidia.Nv17.1% = nv4_novpe, PCI\VEN_10DE&DEV_0170%NVidia.Nv17.2% = nv4_novpe, PCI\VEN_10DE&DEV_0171%NVidia.Nv17.3% = nv4_novpe, PCI\VEN_10DE&DEV_0172%NVidia.Nv17GL.1% = nv4_WSApps_novpe, PCI\VEN_10DE&DEV_0178%NVidia.Nv17GL.2% = nv4_WSApps_novpe, PCI\VEN_10DE&DEV_017Ato avoid this issue set HWID="%%a\%%f&%%g" in :FindDev Edited September 25, 2005 by Bilou_Gateux
vidhuu_ind Posted September 8, 2005 Posted September 8, 2005 Hi Bilou,I got a vbscript to identify which device is not installed properly in windows 2003 server but am not able to get an option to uninstall the same using vbscript.Tried calling ur batch file in my script but it dint work. Do you have any idea on vbscript if it has some option to uninstall the device from device manager.Pls let me know if u have any clue. Thanks!!Vidhya P
Bilou_Gateux Posted September 11, 2005 Author Posted September 11, 2005 (edited) How to run an external program within the same window from a console-mode VBScript Edited September 25, 2005 by Bilou_Gateux
JuMz Posted January 4, 2008 Posted January 4, 2008 Woah!Does this still work or is there now another solution?I was thinking about creating a Universal Driver Disk based of BTS current DP's (a script that would extract the driver packs and use his finisher to integrate the INF/PNF's into the windows directory). I just don't know how to write a script that would detect all hardware that doesn't have proper drivers installed and then remove them and then @ the end, redetect PNP Hardware...Thoughts appreciated!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now