forked from SempaiRock/OutlookRemover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutlookNewBlocker.bat
42 lines (36 loc) · 1.6 KB
/
OutlookNewBlocker.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
:check_Permissions
net session >nul 2>&1
if %errorLevel% == 0 (
echo.
) else (
echo Error: This batch file requires administrative privileges.
echo Right-click OutlookNewBlocker.bat and click "Run as administrator."
echo.
pause
goto konec
)
echo Copying AppxManifest.xml to %AppData%\OutlookNewBlocker
if not exist %AppData%\OutlookNewBlocker mkdir %AppData%\OutlookNewBlocker
copy "%~dp0AppxManifest.xml" "%AppData%\OutlookNewBlocker" >nul
if %errorLevel% neq 0 (
echo AppxManifest.xml not found, attempting to download from GitHub...
curl https://raw.githubusercontent.com/RoboMWM/OutlookNewBlocker/refs/heads/master/AppxManifest.xml -o %AppData%\OutlookNewBlocker\AppxManifest.xml
if %errorLevel% neq 1 (
echo.
echo Error: Failed to create AppxManifest.xml. Download AppxManifest.xml from GitHub and try again.
echo.
pause
goto konec
)
)
echo Modifying registry to enable development mode...
powershell "New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1 -Force" >nul 2>nul
echo Removing Outlook appx package...
powershell "get-appxpackage -allusers Microsoft.OutlookForWindows | Remove-AppxPackage -allusers"
echo Registering AppxManifest.xml...
powershell add-appxpackage -register "%AppData%\OutlookNewBlocker\AppxManifest.xml"
cls
echo Success! OutlookNewBlocker is "installed" and will prevent Windows from installing Outlook new. You should now be able to continue using the Mail and Calendar apps without interruption!
pause
:konec