Pyenb/Outlook-desktop-ad-blocker
A simple script that patches your systems hosts file to stop the Outlook desktop client from displaying ads in your inbox.
Featured achievements
The project's latest awards
#1 Repository of the month
#1 Repository of the month
#1 Repository of the month
Outlook desktop ad blocker
This is a simple patch to the Windows hosts file, that causes the Outlook desktop client to stop displaying those annoying ads in your inbox. There will still be an empty space, but no more ads that you can accidentially click on.
This simply works disallowing your PC to access the domain outlookads.live.com, which outlook uses to fetch the ads it displays.
Contents
Download / How to use it?
Method 1 - PowerShell (Recommended)
- On Windows 8.1/10/11, right-click on the Windows start menu and select PowerShell or Terminal (Not CMD). If you don't know how to do this, check out this article.
- Copy and paste the following command into the PowerShell window and press enter. This command downloads a script from the repository and executes it:
irm https://raw.githubusercontent.com/Pyenb/Outlook-desktop-ad-blocker/main/tools/download.ps1 | iex
- There will be a prompt asking for admin rights (these are needed to edit the hosts file). Press
Yes. - Follow the instructions on screen or check the usage section.
- Restart Outlook desktop and enjoy your ad free experience.
Method 2 - Traditional
- Download the adblock.cmd file to your PC.
- Execute the
adblock.cmdfile. - There will be a prompt asking for admin rights (these are needed to edit the hosts file). Press
Yes. - Follow the instructions on screen or check the usage section.
- Restart Outlook desktop and enjoy your ad free experience.
Method 3 - Manual
- Follow the manual installation below.
Usage
After executing, you will see the following screen. The script will tell you, if the adblocker is already installed or not. To install the adblocker, press 1. To uninstall the adblocker, press 2. To exit the script, press 0. There will be on screen instructions for each step.

Install
When choosing the option 1, the adblocker will be installed.

Uninstall
When choosing the option 2, the adblocker will be uninstalled.

Manual install
Don't trust my script or having problems? This is how you can DIY.
- Open a text editor of your choice as administrator.
- Open the
hostsfile, located atC:\Windows\System32\drivers\etc\hosts. - Add the text
0.0.0.0 outlookads.live.comas a new line inside thehostsfile. - Save the file and restart Outlook desktop.
- Enjoy your ad free experience.
Before and after
Before:

After:

Other OS support
This was only tested on Windows 11, but should work on any other OS. To do this, just search on how to edit your hosts file and make the same edits as in the manual installation. Just make sure you use the correct path to your hosts file.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Disclaimer
This repository is for research purposes only, the use of this code is your responsibility.
I take NO responsibility and/or liability for how you choose to use any of the source code available here. By using any of the files available in this repository, you understand that you are AGREEING TO USE AT YOUR OWN RISK. Once again, ALL files available here are for EDUCATION and/or RESEARCH purposes ONLY.
Similar Projects
Discover other similar projects and AI models.
System-wide ad-blocker and privacy guard for Windows, macOS and Linux.
EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)
Privaxy is the next generation tracker and advertisement blocker. It blocks ads and trackers by MITMing HTTP(s) traffic. Also check out my new project, https://github.com/Barre/ZeroFS
Improve your security and privacy by blocking ads, tracking and malware domains.
Python tool for converting files and office documents to Markdown.