-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSYS-WIN.EVENTS.vbs
31 lines (31 loc) · 1.59 KB
/
SYS-WIN.EVENTS.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
31
' **************************************************************************************************************:
' ********************************************* PURGE SYSTEM EVENTS ********************************************:
' **************************************************************************************************************:
' Author: JBallard (JEB) :
' Date: 2018.3.08 :
' Script: SYSTEM-PURGE.EVENTS.vbs :
' Purpose: A VBScript that calls a batch command script & runs it via administrative mode :
' Version: 1.0 :
' **************************************************************************************************************:
' **************************************************************************************************************:
'
' **************************************************:
' DEFINE PARAMETERS & CONFIGURATION PATHS :
' **************************************************:
Option Explicit
'
DIM WshShell, oShell, ScriptDir
'
SET oShell = CreateObject("Shell.Application")
SET WshShell = WScript.CreateObject("WScript.Shell")
'
ScriptDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(Wscript.ScriptFullName)
If WScript.Arguments.length = 0 Then
oShell.ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """" & " RunAsAdministrator", , "runas", 1
Else
oShell.ShellExecute ScriptDir & "\SYSTEM-WIN.EVENTS.cmd", , , "runas", 1
End If
'
' **********************************:
' END OF SCRIPT :
' **********************************: