Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install drivers automatically by vbs

Shulou Source: shulou.com Published: 2022-06-03 06:43:36 10月05日 Update

This article is about how vbs automatically installs drivers. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

In fact, it's very simple, just register the folder where the inf files of these drivers are located in the registry.

For example:

After we separate the drivers on our computers from the system through software such as driver sprites, if we want to install these drivers automatically the next time we install the system. We can write the folder corresponding to these separated drivers into the registry, and then restart the computer, which will automatically search for hardware and install drivers. Isn't that cool? Here I use winrar+vbs to implement.

For example, we now have the following folders for drivers and their inf files:

Motherboard-maincard

Display card-vga

Sound card-sound

Compress the maincard, vga, sound folders together into an executable file, and set the interface-free / self-extracting path to c:\ device

The compressed file is named d.exe and then the vbs script device.vbs is edited as follows

ON ERROR RESUME NEXT

SET OS=CreateObject ("wscript.shell")

Set filesystem=CreateObject ("scripting.filesystemobject")

Pathy=filesystem.GetFile (WScript.scriptFullName). ParentFolder

Path2= "c:\ drivers\"

Yn=msgbox ("- >" & chr (10) & _

Path2,1, "release driver")

If yn=2 then wscript.quit

Device1=os.regread ("HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows\ CurrentVersion\ DevicePath")

Device2= _

Path2& "and" & _

";" & path2& "maincard" & _

";" & path2& "sound" & _

";" & path2& "vga" & _

";" device1

Os.regwrite "HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows\ CurrentVersion\ DevicePath", device2

Os.run pathy & "\ d.exe / s", 1JI true

Msgbox "driver has been released, please refresh the hardware list or restart your computer in device Manager!"

Thank you for reading! This is the end of the article on "how to automatically install drivers in vbs". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Driver program driver file folder computer content more registry hardware article system good practical motherboard sound card location article time display card Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Microsoft OPPO Reno Xiaomi