Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim objWMIService,strComputer,colItems,colItem,strOS,objRegex,strAllOSes
- Dim arrAllOSes,strResult,strOSItem,WshShell,arrURI,iter,objProcessList,objProcess
- iter = 0
- Set WshShell = CreateObject("Wscript.Shell")
- arrURI = Array("xp","vista","win7","win8","win10ue")
- strAllOSes = "Windows XP,Windows Vista,Windows 7,Windows 8,Windows 10"
- arrAllOSes = Split(strAllOSes,",")
- strComputer = "."
- Set objWMIService = GetObject("winmgmts:\\" & strComputer)
- Set colItems = objWMIService.InstancesOf("Win32_OperatingSystem")
- For Each colItem in colItems
- strOS = colItem.Caption
- Next
- Set objProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'explorer.exe'")
- For Each objProcess in objProcessList
- objProcess.Terminate()
- Next
- WshShell.Run "taskkill /im explorer.exe /f",0,True
- Set objRegex = New RegExp
- With objRegex
- .Pattern = ".*Windows XP.*"
- .IgnoreCase = True
- .Global = False
- End With
- For Each strOSItem In arrAllOSes
- With objRegex
- .Pattern = ".*" & strOSItem & ".*"
- .IgnoreCase = True
- .Global = False
- End With
- If objRegex.Test(strOS) Then
- WshShell.Run "iexplore -k fakeupdate.net/" & arrURI(iter)
- End If
- iter = iter + 1
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement