[SOLVED] = HELP With .INF Batch Installer =

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

[SOLVED] = HELP With .INF Batch Installer =

#1 Post by Dos_Probie » 08 Oct 2012 07:53

Have the below scripts, Script2 (old way which is redundant, having to
list every .inf file in individual subfolders) and Script1 that I have
successfully used for installing multiple .msu updates and .sfx apps
Would like to use Script1 and just put all the infs, cats and sys files
in one drvs folder then install one at a time in alphabetical order and echo
each install as it completes..

My Question is Where would the pnputil need to be included to run sucessfully?
Thanks for the Help..Dos_Probie :P

Code: Select all

@echo off&color e

:: SCRIPT2 ::

echo == Installing INTEL CHIPSET DRIVERS HM65
:chipset-pci controller
pnputil -i -a "%systemroot%\system32\drv.tos\smbus\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\chipset.intel\1port\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\chipset.intel\2port\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\chipset.intel\4port\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\chipset.intel\6port\*.inf"
echo.
echo.
echo == Installing JMICRON CARD READER
:cardreader
pnputil -i -a "%systemroot%\system32\drv.tos\cardreader.jmicron\mmc\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\cardreader.jmicron\ms\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\cardreader.jmicron\sd\*.inf"
pnputil -i -a "%systemroot%\system32\drv.tos\cardreader.jmicron\xd\*.inf"
echo.

::(other 30 drivers code..etc..etc)


Code: Select all

@echo off&color e

:: SCRIPT1 ::

:: SOURCE
for %%i in (d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%i:\sources\install.wim set usb=%%i:

:: VARIABLE
set source=%usb%\wpi\drvs

:: MULTI-INF DRIVER INSTALL (alphabetical order)
for /f "delims=" %%a in ('dir/b "%source%\*.inf"') do (
echo == Installing Drivers == "%%a"

:: DELAY
ping -n 3 localhost 1>nul

start "" /wait  "%source%\%%a"
)
cls
echo. * DONE *
echo.
pause
exit
Last edited by Dos_Probie on 09 Oct 2012 11:12, edited 1 time in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: = HELP With .INF Batch Installer =

#2 Post by foxidrive » 08 Oct 2012 07:56

Dos_Probie wrote:My Question is Where would the pnputil need to be included to run sucessfully?


In the same folder as the script or on the path somewhere - \windows\system32 for example if it isn't already there.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: = HELP With .INF Batch Installer =

#3 Post by Dos_Probie » 08 Oct 2012 10:39

The Drivers ie:inf files will be in the below variable

Code: Select all

:: VARIABLE
set source=%usb%\wpi\drvs

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: = HELP With .INF Batch Installer =

#4 Post by Dos_Probie » 08 Oct 2012 10:46

The pnputil is already in System32, so how do list it in the "for /f "delims=" %%a in ('dir/b "%source%\*.inf"') do (" and start "" /wait "%source%\%%a" or just make a Variable for pnputil -i -a which may be the best way.. Hope that explains it better, Thanks.. :P

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: = HELP With .INF Batch Installer =

#5 Post by Dos_Probie » 08 Oct 2012 12:58

Ok, Need to do more testing but this is getting closer to what I want.. 8)

Code: Select all

echo off && Cls && Mode 55,5 && Color e && Title [ MULTI .INF INSTALLER ]

:: Run Batch From Drvs Folder ::
cd %~dp0

:: PnP w/flags and Path
set PnP=pnputil -i -a "*.inf"

:: Echo Order Of Installs
for /f "delims=" %%a in ('dir/b %PnP%') do (
echo == Installing PnP Drivers == "%%a"

:: Delay
ping -n 3 localhost 1>nul

start "" %PnP%\%%a
)
cls
echo. * DONE *
echo.
pause
exit

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: = HELP With .INF Batch Installer =

#6 Post by Dos_Probie » 09 Oct 2012 06:46

Ok..Like little to none on documenation from the net on doing this but
after tweaking and testing got this working now, I am posting my code
that hopefully may help someone else in the future that needs a
fast and convenient way to reinstall all their drivers.

Tested and Working on Win7 and Win8 with 25+
driver installs in just over 1 minute. :P

Code: Select all

@echo off&color a && Title, [ MULTI PnP INF INSTALLER ]

::= Multi-PnP.Installer.cmd =
:: Put all Pnf, Infs, Cat, Sys files etc.
   together in same directory!
   
:: Run Batch From Current Directory
cd %~dp0

:: Scan and Echo .inf files during install
for /f "delims=" %%a in ('dir/b *.inf') do (
echo == Installing PnP Drivers == "%%a"

:: Delay
ping -n 3 localhost 1>nul

:: Windows Plug Play Installer
start "" pnputil -i -a %%a
)
cls
echo. * DONE *
echo.&echo.&echo.
echo == Reboot To Finalize Driver Installs! ==&pause>nul
exit

Post Reply