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