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 realize pure script backup by vbs

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

Share

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

This article mainly introduces vbs how to achieve pure script backup, the article is very detailed, has a certain reference value, interested friends must read it!

Description:

It can't be said that this script is more perfect than the drive wizard, but it does make up for the deficiency of the drive wizard!

This version is enhanced by my previous version (with the help of the DevCon script-only backup driver) and is already the perfect version.

1. Support backing up the full WHQL digital signature (not supported by the driver wizard 2005 Professional Edition I have on hand).

2. Intelligently judge the drivers installed in the system, and only back up the drivers installed by the user, and print information if the device contains a WHQL digital signature.

3, support driver file packaging and storage, double-click a single device name named .exe self-decompression to restore the driver, restore the driver is so easy.

4. Support quiet plug-in to install updated drivers, which is convenient for system integration and Ghost users to call.

5. Be compatible with the project that the driver wizard has backed up, that is, run the script to restore the project that the driver wizard has backed up.

The restore method puts DevUpdate.Cmd Tools in the directory where the wizard has backed up the driver file, and runs DevUpdate.Cmd

6, open source code without any encryption, as long as you also understand the script completely self-modification to achieve their own needs! Just don't change your face; -)

Supplementary note:

EXE self-decompression restore driver auto answer parameter-y such as "D:\ Dev\ NVIDIA GeForce4 MX MX 400.exe"-y

Packaged and integrated NVIDIA GeForce4 MX MX 400.exe is limited to restore updates on this machine, and I do not guarantee that it will work on all NVIDIA GeForce4 series graphics cards, because the hardware ID of each machine is not exactly the same.

This version does not support Win2000,Win2000 users can consider using the previous version to backup, I do not have test conditions under Vista, so.

All right, I won't post any more pictures and texts. In a word, the backup and restore driver is simple and simple, and both rookies and experts are suitable for ^ _ ^.

Subroutine description

Devcon.exe Microsoft replaces device Manager Command Line Utility

Devcon_64.exe Microsoft replaces device Manager Command Line Utility 64 Bit

Sleep.exe is used for batch processing to pause or wait for the user to press a key

Update.cmd updates device driver code

Dev.sfx is used to make self-decompression module of integrated driver.

7za.exe 's Chinese version of 7-zip Command Line Independent Compression tool (this version relies on DLL library)

Any suggestions and comments and BUG submission are welcome to visit the following address

[original] with DevCon pure script backup driver

Dev.vbs

The code is as follows:

On Error Resume Next

Set aArgs=WScript.Arguments

If aArgs.Count=0 Then MsgBox "Please run DevBackup.Cmd to start backup driver!", 64, "BY: fastslz": Wscript.Quit

Set Fso = CreateObject ("Scripting.FileSystemObject")

Set aNet = CreateObject ("Wscript.Network")

StrComputer = aNet.ComputerName:aUser = aNet.UserName:aErr = "0"

Set aGroup = GetObject ("WinNT://" & strComputer & "/ Administrators")

For Each aUsers in aGroup.Members

If aUsers.Name = aUser Then aErr= "1"

Next

Set WMI = GetObject ("winmgmts:\\" & strComputer & "\ root\ cimv2")

Set aItems = WMI.ExecQuery ("Select * from Win32_PnPSignedDriver")

If aErr = 0 Then MsgBox "this program must be run as a system administrator", 4160, "prompt": Wscript.Echo "1": Wscript.Quit

If aItems.Count=0 Then MsgBox "WMI component runtime error, this will happen to WinXP Lite Win2000 system", 4160, "Tip": Wscript.Echo "2": Wscript.Quit

Path = Left (Wscript.ScriptFullName,Len (Wscript.ScriptFullName)-Len (Wscript.ScriptName))

BakPath = Path& "Drivers\"

If Fso.FolderExists (BakPath) = False Then Fso.CreateFolder (BakPath)

For Each aItem in aItems

If Instr (aItem.InfName,Chr & Chr & Chr) > 0 Then

DevName = Replace (aItem.DeviceName, "/", ")

DevName = Replace (DevName, "\", ")

DevName = Replace (DevName, "*", ")

DevName = Replace (DevName, ",")

DevName = Replace (DevName, "|", ")

DevName = Replace (DevName, ">", ")

DevName = Replace (DevName, "

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