-
Notifications
You must be signed in to change notification settings - Fork 6
/
2022-10-09_uninstall.vbs
30 lines (26 loc) · 1.02 KB
/
2022-10-09_uninstall.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
on error resume next
Dim WSHShell, FSO, file1, file2, path1, path2, name1, name2
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
'///////////////////////////////////////////////////
name1 = "winsvc.exe"
name2 = "fontdrv.exe"
'///////////////////////////////////////////////////
ProcessClose(name1)
ProcessClose(name2)
Function ProcessClose(sProcName)
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = '" & sProcName & "'")
For Each objProcess in colProcessList
objProcess.Terminate()
WScript.Sleep 2000
Next
End Function
path1 = WSHShell.SpecialFolders("Startup")&"\"&name1
path2 = WSHShell.SpecialFolders("Startup")&"\"&name2
Set file1 = FSO.GetFile(path1)
If objFS.FileExists(path1) then file1.delete
Set file2 = FSO.GetFile(path2)
If objFS.FileExists(path2) then file2.delete
FSO.GetFile(WScript.ScriptFullName).delete