View difference between Paste ID: UmAYUmFr and 3NEcjb30
SHOW: | | - or go back to the newest paste.
1
:: steamwebhelper Killer by AveYo 1.2, all right reserved
2
:: When you want to play games without lag, cpu, memory spikes caused by steamwebhelper, launch this.
3
:: It will run at all times, until you use "Stop steamwebhelper killer.bat" from http://pastebin.com/download.php?i=jQ5M3746
4
:: Changes from 1.1: removed dependency on steam.exe process
5
@ECHO OFF
6
7-
SET "REPEAT_TASK_EVERY_MINUTES=4"
7+
SET "REPEAT_TASK_EVERY_MINUTES=10"
8
9
:: Gain admin rights
10
if "%1"=="_SELF_ADMIN"  goto :_START
11
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\~1337run.vbs"
12
echo UAC.ShellExecute "%~s0", "_SELF_ADMIN %~sdp0", "", "runas", 1 >> "%temp%\~1337run.vbs"
13
CALL CSCRIPT //nologo "%temp%\~1337run.vbs" &DEL /F /Q "%temp%\~1337run.vbs" &EXIT /B
14
:_START
15
SHIFT
16
::
17
18
:: Set task to start two minutes later. needed because a system task cannot be started ondemand with the SCHTASKS /Run command :( 
19
CALL :SCHEDULE_TIME
20
:: create task to kill steamwebhelper's minions every 4 minutes - using system account so the taskkill cmd prompt is not visible
21
CALL SCHTASKS /create /ru "System"  /TN steamwebhelper_killer /TR "TASKKILL /F /IM steamwebhelper.exe /T" /SC MINUTE /MO %REPEAT_TASK_EVERY_MINUTES% /ST %SCHEDULETIME% /F
22
echo INFO: steamwebhelper's are killed every %REPEAT_TASK_EVERY_MINUTES% minutes starting %SCHEDULETIME%. 
23
echo INFO: If you want this prompt hidden, use something like hidebat.vbs in the shortcut target...
24
rem :: launch steam.exe and wait for it
25
rem FOR /F "tokens=3*" %%I IN ('REG QUERY "HKCU\SOFTWARE\Valve\Steam"^|FINDSTR /I /L "SteamExe"') DO SET "STEAMEXE=%%~I"
26
rem SET "STEAMEXE=%STEAMEXE:/=\%"
27
rem START "" /WAIT "%STEAMEXE%" -silent
28
:: delete task after closing Steam so it only runs while Steam is running
29
rem SCHTASKS /Delete /TN steamwebhelper_killer /F
30
31
:: Set schedule to start in two minutes
32
goto :EOF
33
:SCHEDULE_TIME
34
FINDSTR "'~1337ti%skip%m" "%~f0">"%temp%\~1337tim.vbs"
35
CALL CSCRIPT //nologo "%temp%\~1337tim.vbs" >"%temp%\~1337tim.cmd"
36
CALL "%temp%\~1337tim.cmd" &DEL /F /Q "%temp%\~1337tim.vbs"
37
DEL /F /Q "%temp%\~1337tim.cmd"
38
goto :EOF
39
sNow = DateAdd("n", 2, Now) '~1337tim
40
sHour = Hour(sNow) '~1337tim
41
sMinute = Minute(sNow) '~1337tim
42
If sHour < 10 Then sHour = 0 & sHour '~1337tim
43
If sMinute < 10 Then sMinute = 0 & sMinute '~1337tim
44
WScript.echo "SET SCHEDULETIME=" & sHour & ":" & sMinute & ":00" '~1337tim
45
46
47
rem SET "STIME=%TIME: =0%"
48
rem SET H=%STIME:~0,2% &SET "M=%STIME:~3,2%"
49
rem IF [%H:~0,1%]==[0] SET "H=%H:~1,1%"
50
rem IF [%M:~0,1%]==[0] SET "M=%M:~1,1%"
51
rem IF %M% GEQ 58 IF %H% GEQ 23 SET "H=00" &SET "M=00"
52
rem IF %M% GEQ 58 IF %H% LEQ 22 SET /A "H+=1" &SET "M=00"
53
rem IF %M% LEQ 57 SET /A "M+=2"
54
rem IF NOT [%H:~0,1%]==[0] IF %H% LEQ 9 SET "H=0%H%"
55
rem IF NOT [%M:~0,1%]==[0] IF %M% LEQ 9 SET "M=0%M%"
56
rem SET "SCHEDULETIME=%H%:%M%:00"
57
rem goto :EOF