Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install drivers automatically by vbs

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report