@echo off
echo ========================================
echo  DISABLING "Open File - Security Warning"
echo ========================================

:: Disable saving zone information (for current user)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v SaveZoneInformation /t REG_DWORD /d 1 /f

:: Disable saving zone information (for all users — if run as admin)
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v SaveZoneInformation /t REG_DWORD /d 1 /f

:: Disable SmartScreen (Explorer)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v SmartScreenEnabled /t REG_SZ /d Off /f

:: Disable SmartScreen (Internet Explorer)
reg add "HKCU\Software\Microsoft\Internet Explorer\PhishingFilter" /v EnabledV9 /t REG_DWORD /d 0 /f

:: Disable Attachment Execution Service (IE)
reg add "HKCU\Software\Microsoft\Internet Explorer\Download" /v CheckExeSignatures /t REG_SZ /d no /f

:: Allow application launching without confirmation
reg add "HKCU\Software\Microsoft\Windows\Shell" /v DisallowRun /t REG_DWORD /d 0 /f

:: Set security zone policy: allow file launching from Internet zone
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v 1806 /t REG_DWORD /d 0 /f

:: Same for Local Intranet zone
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1" /v 1806 /t REG_DWORD /d 0 /f

:: Remove OpenWith policy
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe\UserChoice" /f

:: Disable Attachment Manager (IE Policy)
reg add "HKCU\Software\Policies\Microsoft\Internet Explorer\Main" /v DisableAttachmentManager /t REG_DWORD /d 1 /f

echo.
echo All registry keys added. To apply changes:
echo Please restart your computer.
pause