We help IT Professionals succeed at work.

VBS/Batch install drivers?

snyderkv
snyderkv asked
on
535 Views
Last Modified: 2012-05-08
I have the boring task of installing about 20 or 30 drivers on every server in the network. SMS can't get to them all so we are just doing them manually for now.

So what I have to do is right click and select "Install" on each inf driver but they are within a series of folders. I can find them by running command dir c:\Temp\CARDRE~1\* /s | FIND /I ".inf"

Once I have them I know I can install them via batch or VBS I just don't know how to iterate through each driver while confirming each ran. I'm thinking of a for each loop but I'm not that great a scripter.

Heeelp please. Thanks everybody
dir c:\Temp\CARDRE~1\* /s | FIND /I ".inf"
 
R20_W2k.inf
R20V2W2K.INF
R20V3.INF
Scr111.inf
Scr111.inf
Scr201_W9x.inf
SCR201_NT4.inf
SCR201_W2k.inf
SCR24X4.inf
SCR24X9X.inf
SCR24X.inf
Stcusb.inf
STCUSB.INF
Autorun.inf
SCR331.INF
STC2DFU.INF
SCR33X2K.inf
SCR33X9X.inf
SCR3XX.inf
SCR3XX9X.inf
STC2DFU.INF

Open in new window

Comment
Watch Question

Author

Commented:
Ok I found out how to install just one
rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 c:\SCR3XX.inf

So I have both commands. I just need to iterate through the list probably with a for each loop. Will keep working it or die trying.
Test your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hm it says the syntax of this command is incorrect. I will look over it.

Author

Commented:
Ok it worked after getting rid of the Echo cmd

Thanks a bunch. I didn't know you could do that in just a couple simple lines of code.
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Glad that helped.  Windows batch "script" language is quite a bit more powerful than most people know...

~bp
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.