Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Error Resume Next
- key = CreateObject("WScript.Shell").RegRead("HKEY_USERS\S-1-5-19\")
- If err.number <> 0 Then
- Set UAC = CreateObject("Shell.Application")
- UAC.ShellExecute "wscript.exe", Chr(34) & _
- WScript.ScriptFullName & Chr(34), "", "runas", 1
- WScript.Quit()
- End If
- On Error Resume Next
- Dim strPciFileVersion
- Dim WindirFilePath
- set WshShell = WScript.CreateObject("WScript.Shell")
- WindirFilePath = WshShell.ExpandEnvironmentStrings("%WinDir%")
- Dim fs
- Set fs = CreateObject("Scripting.FileSystemObject")
- strPciFileVersion = fs.getfileversion(WindirFilePath & "\\system32\\drivers\\pci.sys")
- Dim strAryFileVersion1
- strAryFileVersion1 = Split(strPciFileVersion, ".")
- If (strAryFileVersion1(0) = 6 And strAryFileVersion1(1) = 1 And strAryFileVersion1(2) = 7601) Then
- If (strAryFileVersion1(3) < 17630 Or (strAryFileVersion1(3) > 20000 And strAryFileVersion1(3) < 21744)) Then
- Const HKEY_LOCAL_MACHINE = &H80000002
- Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
- Dim oShell : Set oShell = CreateObject("WScript.Shell")
- Dim sPath, aSub, sKey, aSubToo, sKeyToo, dwValue, Result, SaveResult
- Dim NotDeleted
- NotDeleted = 0
- ' Get all keys within sPath
- sPath = "SYSTEM\CurrentControlSet\Enum\PCI"
- oReg.EnumKey HKEY_LOCAL_MACHINE, sPath, aSub
- ' Loop through each key
- For Each sKey In aSub
- ' Get all subkeys within the key 'sKey'
- oReg.EnumKey HKEY_LOCAL_MACHINE, sPath & "\" & sKey, aSubToo
- For Each sKeyToo In aSubToo
- Result = oReg.DeleteKey(HKEY_LOCAL_MACHINE, sPath & "\" & sKey & "\" & sKeyToo & "\" & "\Device Parameters" & "\SlotPersistentInfo")
- ' Allow failure only if key never existed
- If (Result = 1) Or (Result > 2) Then
- NotDeleted = 1
- SaveResult = Result
- End If
- Next
- Next
- If (NotDeleted > 0) Then
- MsgBox "SlotPersistentInfo keys still exist under HKLM\System\CurrentControlSet\Enum\PCI\<deviceid>\<subdeviceid>\Device Parameters. Please delete all manually and then install the updates."
- End If
- Else
- MsgBox "Your system is ready to install the updates"
- End If
- Else
- MsgBox "Your system is ready to install the updates"
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement