-
Notifications
You must be signed in to change notification settings - Fork 0
/
InfoEventMon.Bat
155 lines (147 loc) · 3.88 KB
/
InfoEventMon.Bat
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
REM Script: InfoEventMon.Bat
@echo off
:: Initialization
mode con cols=67 lines=32
color 80
title InfoEventMon
cd /d "%~dp0"
set ErrorLog=.\cache\Errors-Crash.Log
echo.
echo =========================( InfoEventMon )==========================
echo.
timeout /t 1 /nobreak >nul
echo Maintenenace Started..
if exist ".\cache\ProgramEvents.Log" (
echo Deleted: ProgramEvents.Log
del ".\cache\ProgramEvents.Log"
)
if exist ".\cache\SystemEvents.Log" (
echo Deleted: SystemEvents.Log
del ".\cache\SystemEvents.Log"
)
echo ..Maintenance Done.
echo.
timeout /t 1 /nobreak >nul
echo Launcher Initialized...
echo.
timeout /t 2 /nobreak >nul
:: Main Menu
:menu
cls
echo ^_^_^_ ^_^_ ^_^_^_^_^_ ^_ ^_^_ ^_^_
echo ^|^_ ^_^|^_^_^_^_ ^/ ^_^| ^_^_^_ ^| ^_^_^_^_^| ^_^_^_^_^_ ^_^_^_^_ ^| ^|^_^| ^\^/ ^| ^_^_^_ ^_^_^_^_
echo ^| ^|^| ^_ ^\^| ^|^_ ^/ ^_ ^\^| ^_^|^\ ^\ ^/ ^/ ^_ ^\ ^_ ^\^| ^_^_^| ^|^\^/^| ^|^/ ^_ ^\^| ^_ ^\
echo ^| ^|^| ^| ^| ^| ^_^| ^<^_^> ^| ^|^_^_^_^\ V ^/ ^_^_^/ ^| ^| ^| ^|^_^| ^| ^| ^| ^<^_^> ^| ^| ^| ^|
echo ^|^_^_^_^|^_^| ^|^_^|^_^| ^\^_^_^_^/^|^_^_^_^_^_^|^\^_^/ ^\^_^_^_^|^_^| ^|^_^|^\^_^_^|^_^| ^|^_^|^\^_^_^_^/^|^_^| ^|^_^|
echo.
echo =========================( InfoEventMon )==========================
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo 1. Run InfoEventMon,
echo.
echo 2. Check Integrity,
echo.
echo 3. Clean Error Log.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo -------------------------------------------------------------------
:: Variables
set /p choice=Select, Options=1-3, Exit=X:
if "%choice%"=="1" goto executeMain
if "%choice%"=="2" goto checkScript
if "%choice%"=="3" goto cleanLog
if "%choice%"=="x" goto end
echo Invalid choice. Try again.
timeout /t 2 /nobreak >nul
goto menu
:: Execute main.py
:executeMain
cls
echo.
echo =========================( InfoEventMon )==========================
echo.
timeout /t 1 /nobreak >nul
echo Maintenenace Started..
if exist ".\cache\Errors-Crash.Log" (
echo Deleted: Errors-Crash.Log
del ".\cache\Errors-Crash.Log"
)
echo ..Maintenance Done.
echo.
timeout /t 1 /nobreak >nul
echo Launching Script...
echo.
timeout /t 1 /nobreak >nul
where pwsh >nul 2>&1
if %ERRORLEVEL% equ 0 (
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File ".\main.ps1" 2>>".\cache\Errors-Crash.Log"
echo ...Psc Process Exited.
) else (
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\main.ps1" 2>>".\cache\Errors-Crash.Log"
echo ...Ps Process Exited.
)
echo.
color 80
echo Returning to menu..
timeout /t 3 /nobreak >nul
goto menu
:: Check File Structure
:checkScript
cls
echo.
echo =========================( InfoEventMon )==========================
echo.
echo Checking Script Files..
set missing=0
timeout /t 1 /nobreak >nul
if not exist ".\scripts\cleaner.ps1" set missing=1
if not exist ".\scripts\utility.ps1" set missing=1
if not exist ".\scripts\display.ps1" set missing=1
if not exist ".\main.ps1" set missing=1
if %missing%==1 (
echo ..Failure, Re-Install Program!
) else (
echo ..Program Files Correct.
)
echo.
timeout /t 1 /nobreak >nul
echo Returning to menu..
echo.
timeout /t 2 /nobreak >nul
goto menu
:: Clean Error Logs
:cleanLog
cls
echo.
echo =========================( InfoEventMon )==========================
echo.
echo Cleaning Errors-Crash.Log..
if exist ".\cache\Errors-Crash.Log" (
echo ..Cleaning Errors-Crash.Log..
powershell.exe -NoProfile -File ".\scripts\cleaner.ps1"
) else (
echo ..Errors-Crash.Log Missing..
)
Echo ..Cleaning Complete.
echo.
timeout /t 1 /nobreak >nul
echo Returning to menu..
echo.
timeout /t 2 /nobreak >nul
goto menu
:: End Function
:end
echo ...Exit Process Initiated.
timeout /t 2 /nobreak >nul