-
Notifications
You must be signed in to change notification settings - Fork 1
/
game_mode_on.bat
51 lines (44 loc) · 1.49 KB
/
game_mode_on.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
@echo off
rem Craigs Game Mode
rem kills all non-gaming related apps running in service tray
rem Craig M. Rosenblum [email protected]
rem set variable
set count=1
rem show into menu
echo :::::::::::::::::::::::::::::::::::::
echo :: ::
echo :: Game Mode ON ::
echo :: ::
echo :: This kills system tray apps ::
echo :: to improve performance when ::
echo :: gaming...Enjoy!! ::
echo :: ::
echo :: ::
echo :::::::::::::::::::::::::::::::::::::
call :KillTask Discord discord.exe
call :KillTask Lightbulb LightBulb.exe
call :KillTask SpyBot SDTray.exe
call :KillTask Webcam CameraHelperShell.exe
call :KillTask Garmin express.exe
call :KillTask Rainmeter Rainmeter.exe
goto end
:KillTask
rem https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script
rem echo check for %~1 running %~2
if "%~1"=="" (
rem parameter not passed
echo :: Parameter not passed
) else (
rem program found so lets kill it
tasklist /FI "IMAGENAME eq %~2" 2>NUL | find /I /N "%~2">NUL
if "%ERRORLEVEL%"=="1" (
echo :: %~1 program is running
echo :: Now killing %~1
taskkill /F /IM %~2 >nul 2>&1
) else (
rem program is not running therefore doesnt need to be killed
echo :: %~1 program not running [%ERRORLEVEL%]
)
)
:end
rem echo :: Finished.................... :