View difference between Paste ID: pTgHe5RW and UmAYUmFr
SHOW: | | - or go back to the newest paste.
1-
:: steamwebhelper Killer by AveYo 1.2, all right reserved
1+
<!-- : SteamWebHelper Killer by AveYo v2.0rc
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
3+
:: But if you do long trading sessions and other community stuff inside Steam - disable it or set a 30+ timer.
4-
:: Changes from 1.1: removed dependency on steam.exe process
4+
5-
@ECHO OFF
5+
:: Only need to run it once, it will be scheduled to run every x minutes, even after reboot.
6
:: To disable, run this script again and press CANCEL / enter 0 as timer.
7-
SET "REPEAT_TASK_EVERY_MINUTES=10"
7+
8
:: Updating this as it's still needed on many systems, even after Valve's performance patches.
9-
:: Gain admin rights
9+
:: Finally fixed the in-game stutter on timer, with a smarter schedulled command - the host process will remain alive. Even a 1 minute timer is stutter-free now.
10-
if "%1"=="_SELF_ADMIN"  goto :_START
10+
:: Default timer is set to 4 minutes like the original, anything less will require you to refresh/reopen the steam window too often (annoyiance).
11-
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\~1337run.vbs"
11+
@ECHO OFF &SETLOCAL ENABLEEXTENSIONS
12-
echo UAC.ShellExecute "%~s0", "_SELF_ADMIN %~sdp0", "", "runas", 1 >> "%temp%\~1337run.vbs"
12+
13-
CALL CSCRIPT //nologo "%temp%\~1337run.vbs" &DEL /F /Q "%temp%\~1337run.vbs" &EXIT /B
13+
:: Change default timer below:
14-
:_START
14+
SET REPEAT_TASK_EVERY_MINUTES=4
15-
SHIFT
15+
16
17
CALL :_INIT_
18-
:: Set task to start two minutes later. needed because a system task cannot be started ondemand with the SCHTASKS /Run command :( 
18+
echo Info: This script sets a system task so it requires administrative rights
19-
CALL :SCHEDULE_TIME
19+
CALL :VBSLAUNCHER %REPEAT_TASK_EVERY_MINUTES% %_XPFallback%
20-
:: create task to kill steamwebhelper's minions every 4 minutes - using system account so the taskkill cmd prompt is not visible
20+
exit
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
21+
22-
echo INFO: steamwebhelper's are killed every %REPEAT_TASK_EVERY_MINUTES% minutes starting %SCHEDULETIME%. 
22+
:_INIT_
23-
echo INFO: If you want this prompt hidden, use something like hidebat.vbs in the shortcut target...
23+
FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET _LABEL=A^v^eY^o^'s St^ea^m^W^e^bH^e^lp^e^r^ K^il^ler^ v^2.^0r^c &SET _WINVERSION=%%i%%j
24-
rem :: launch steam.exe and wait for it
24+
MODE 80,20 &COLOR 70 &CLS &echo. &TITLE CMD: %_LABEL%
25-
rem FOR /F "tokens=3*" %%I IN ('REG QUERY "HKCU\SOFTWARE\Valve\Steam"^|FINDSTR /I /L "SteamExe"') DO SET "STEAMEXE=%%~I"
25+
IF %_WINVERSION% LSS 60 (SET _XPFallback="/V1 /F") ELSE SET _XPFallback="/F"
26-
rem SET "STEAMEXE=%STEAMEXE:/=\%"
26+
GOTO :eof
27-
rem START "" /WAIT "%STEAMEXE%" -silent
27+
28-
:: delete task after closing Steam so it only runs while Steam is running
28+
:VBSLAUNCHER
29-
rem SCHTASKS /Delete /TN steamwebhelper_killer /F
29+
cscript //nologo "%~f0?.wsf" %*
30
GOTO :eof
31-
:: Set schedule to start in two minutes
31+
----- embeded scripts method by DosTips user Liviu --->
32-
goto :EOF
32+
<job><script language="VBScript">
33-
:SCHEDULE_TIME
33+
sKillerTimer = Trim(InputBox("To enable Killer, press OK" &vbCrLf&vbCrLf& "To disable Killer, press CANCEL" &vbCrLf&vbCrLf& "To do nothing, close the CMD window" &vbCrLf&vbCrLf& "If activated, will autorun after how many minutes:"  , "AveYo`s SteamWebHelper Killer", Wscript.Arguments(0)))
34-
FINDSTR "'~1337ti%skip%m" "%~f0">"%temp%\~1337tim.vbs"
34+
Set UAC = CreateObject("Shell.Application")
35-
CALL CSCRIPT //nologo "%temp%\~1337tim.vbs" >"%temp%\~1337tim.cmd"
35+
If Not IsNumeric(sKillerTimer) Or sKillerTimer="0" Then
36-
CALL "%temp%\~1337tim.cmd" &DEL /F /Q "%temp%\~1337tim.vbs"
36+
UAC.ShellExecute "SCHTASKS.EXE", "/Delete /TN SteamWebHelper_Killer_by_AveYo /F", "", "runas", 0
37-
DEL /F /Q "%temp%\~1337tim.cmd"
37+
Else
38-
goto :EOF
38+
sNow = DateAdd("n", 1, Now)
39-
sNow = DateAdd("n", 2, Now) '~1337tim
39+
sHour = Hour(sNow)
40-
sHour = Hour(sNow) '~1337tim
40+
sMinute = Minute(sNow)
41-
sMinute = Minute(sNow) '~1337tim
41+
If sHour < 10 Then sHour = "0" & sHour
42-
If sHour < 10 Then sHour = 0 & sHour '~1337tim
42+
If sMinute < 10 Then sMinute = "0" & sMinute
43-
If sMinute < 10 Then sMinute = 0 & sMinute '~1337tim
43+
sKillerStart = sHour & ":" & sMinute & ":00"
44-
WScript.echo "SET SCHEDULETIME=" & sHour & ":" & sMinute & ":00" '~1337tim
44+
sWinXP = "" '"/V1 /F"
45
UAC.ShellExecute "SCHTASKS.EXE", "/Create /RU ""System"" /SC MINUTE /MO " &sKillerTimer& " /TN SteamWebHelper_Killer_by_AveYo /TR ""WMIC.EXE process WHERE (name=" &Chr(39)& "steamwebhelper.exe" &Chr(39)& " AND commandline LIKE " &Chr(39)& "%Valve Steam Client%" &Chr(39)& ") call terminate"" /ST " &sKillerStart& " /NP " &Wscript.Arguments(1), "", "runas", 0
46
End If
47-
rem SET "STIME=%TIME: =0%"
47+
</script></job>