Abaksoft Posted April 14, 2020 Share Posted April 14, 2020 Dear Unigueers; Although it is not advisable to deploy your Unigui application on Windows 10 (always use Server editions), here is a procedure to automatically bypass the Windows Defender firewall. Have Fun procedure TForm2.Exclusion_Windows_Defender; var MyExeFile, Folder, St:string; begin MyExeFile:='"' + 'C:\Program Files (x86)\Project1.exe' + '"'; try //1. Add Exclusion Path St:='/K powershell Add-MpPreference -ExclusionPath ''' + MyExeFile + ''''; Folder:='C:\Windows\System32'; ShellExecute(Application.Handle, // uses ShellAPI 'runas', 'cmd.exe', PChar(St), Pchar(Folder), SW_Hide); //2. Add Exclusion process St:='/K powershell Add-MpPreference -ExclusionProcess ''' + MyExeFile + ''''; Folder:='C:\Windows\System32'; ShellExecute(Application.Handle, 'runas', 'cmd.exe', PChar(St), Pchar(Folder), SW_Hide); finally end; // Wait fo about 5 secondes ... sleep(5000); end; 3 1 Link to comment Share on other sites More sharing options...
Abaksoft Posted April 7, 2022 Author Share Posted April 7, 2022 It is also valuable for windows server editions, as win defender is activated there Link to comment Share on other sites More sharing options...
andyhill Posted April 17, 2022 Share Posted April 17, 2022 Just curious, with windows defender firewall, is this a permanent rule entry or only a dynamic runtime bypass solution ? Also would not this code be needed in the ServerModule before the binding of the port, not after at the form level as you have shown ? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now