pythonで自作したスクレイピングプログラムをexe化して、定期的に実行しているのですが、ある時からexeファイルがなくなっていることが判明しました。
原因は、Windowsセキュリティで「ウイルスの脅威」と判断され削除されていました。
今回は、自作したexeファイルが削除されないようにする方法を紹介します。
Windows セキュリティでブロックされたファイルを除外する方法
「設定」 > 「プライバシーとセキュリティ」 > 「Windowsセキュリティ」を開きます。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-1-1024x693.jpg)
「ウイルスと脅威の防止」を開きます。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-2-1024x694.jpg)
「ウイルスと脅威の防止」にある設定の管理をクリックします。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-3-1024x797.jpg)
「ウイルスと脅威の防止の設定」の下の方にある「除外」から除外の追加または削除をクリックします。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-4-1024x796.jpg)
「除外の追加」 > 「ファイル」 で対象のファイル(今回の場合、main.exe)を選択します。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-1024x796.png)
![](https://mashimashi.net/wp-content/uploads/2023/08/image-1-1024x577.png)
対象のファイルが除外の一覧に表示されれば、設定完了です。
![](https://mashimashi.net/wp-content/uploads/2023/08/image-2-1024x796.png)
以上、『Windows セキュリティでブロックされたファイルを除外する方法』でした
コメント