Skip to content

Commit

Permalink
master update
Browse files Browse the repository at this point in the history
  • Loading branch information
cttynul committed May 9, 2016
1 parent 3ec9062 commit e760c06
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12,150 deletions.
72 changes: 55 additions & 17 deletions Edge Adblock.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ IF %ERRORLEVEL% == 0 (
GOTO EOF
)

:DOWNLOADHOSTS
:: Downloading hosts file
>"%temp%\gethosts.vbs" ECHO Set objArgs = WScript.Arguments
>>"%temp%\gethosts.vbs" ECHO url = objArgs(0)
>>"%temp%\gethosts.vbs" ECHO pix = objArgs(1)
>>"%temp%\gethosts.vbs" ECHO With CreateObject("MSXML2.XMLHTTP")
>>"%temp%\gethosts.vbs" ECHO .open "GET", url, False
>>"%temp%\gethosts.vbs" ECHO .send
>>"%temp%\gethosts.vbs" ECHO a = .ResponseBody
>>"%temp%\gethosts.vbs" ECHO End With
>>"%temp%\gethosts.vbs" ECHO With CreateObject("ADODB.Stream")
>>"%temp%\gethosts.vbs" ECHO .Type = 1 'adTypeBinary
>>"%temp%\gethosts.vbs" ECHO .Mode = 3 'adModeReadWrite
>>"%temp%\gethosts.vbs" ECHO .Open
>>"%temp%\gethosts.vbs" ECHO .Write a
>>"%temp%\gethosts.vbs" ECHO .SaveToFile pix, 2 'adSaveCreateOverwrite
>>"%temp%\gethosts.vbs" ECHO .Close
>>"%temp%\gethosts.vbs" ECHO End With
cscript /nologo "%temp%\gethosts.vbs" http://someonewhocares.org/hosts/hosts "%~dp0hosts" 2>nul
DEL "%temp%\gethosts.vbs"
GOTO EOF

:MENU
CLS
ECHO _____ _ ___ _ _ _ _
Expand Down Expand Up @@ -72,23 +94,36 @@ IF %M%==3 GOTO README
IF %M%==4 GOTO EOF

:ENABLE
CALL :DOWNLOADHOSTS
SET hostpath=%Windir%\System32\drivers\etc
ECHO.
ECHO ___________________________________________________________________________
ECHO .
ECHO DEVELOPER MESSAGE: If requested select F as File! This will backup ur config
ECHO ___________________________________________________________________________
ECHO.
XCOPY /f /y %hostpath%\hosts %hostpath%\hosts_back
TYPE "%~dp0hosts" >> %hostpath%\hosts
REGEDIT "%~dp0regenable.reg"
ECHO Edge Adblock Enabled - Launch dir: "%~dp0" >> %hostpath%\edgeadblock.log
ECHO Done! Log file created %hostpath%\edgeadblock.log
ECHO If it seems not working reboot your system!
ECHO.
PAUSE
CLS
GOTO MENU

IF EXIST "%~dp0hosts" (
ECHO.
ECHO ___________________________________________________________________________
ECHO.
ECHO If requested select F as File! This will backup ur config
ECHO ___________________________________________________________________________
ECHO.
XCOPY /f /y %hostpath%\hosts %hostpath%\hosts_back
TYPE "%~dp0hosts" >> %hostpath%\hosts
REGEDIT "%~dp0regenable.reg"
ECHO Edge Adblock Enabled - Launch dir: "%~dp0" >> %hostpath%\edgeadblock.log
ECHO Done! Log file created %hostpath%\edgeadblock.log
ECHO If it seems not working reboot your system!
ECHO.
PAUSE
CLS
GOTO MENU
) ELSE (
ECHO.
ECHO ################## ERROR: CANNOT DOWNLOAD HOSTS FILE #####################
ECHO Failure: Cannot download hosts file from someonewhocares.org
ECHO Check your internet connection and retry.
ECHO ##########################################################################
ECHO.
PAUSE
GOTO EOF
)

:DISABLE
SET hostpath=%Windir%\System32\drivers\etc
Expand Down Expand Up @@ -123,10 +158,13 @@ ECHO malicious, ads website and Windows 10 Telemetry.
ECHO Hosts file used in this script is provided by Dan Pollock
ECHO www.someonewhocares.org
ECHO.
ECHO License: GNU General Public License
ECHO.
ECHO To make this script working run bat file as admin.
ECHO Edge Adblock requires Windows 7, 8, 8.1 or 10.
ECHO Project on GitHub https://github.com/cttynul/
ECHO Project on GitHub https://github.com/cttynul/edge-adblock
ECHO.
PAUSE
CLS
GOTO MENU

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Edge Telemetry&Ads Block
Edge Adblock
======
###Introduction
Edge Telemetry&Ads Block makes the internet not suck. It provides blocking malicious and ads website. Now it blocks **Windows 10 Telemetry**!
Edge Adblock makes the internet not suck. It provides blocking malicious and ads website. Now it blocks **Windows 10 Telemetry**!

Hosts file used in this script is provided by [**Dan Pollock**](http://someonewhocares.org).

Expand All @@ -22,5 +22,9 @@ https://github.com/cttynul/edge-adblock/releases/

3) Enjoy

### License
GNU General Public License.

### Thanks to
- [Dan Pollock](http://someonewhocares.org) for hosts file.
- [Adguard](https://adguard.com) for mirroring my code on [Edgeadblock.com](http://edgeadblock.com)
Loading

0 comments on commit e760c06

Please sign in to comment.