-
Notifications
You must be signed in to change notification settings - Fork 0
/
edge_fix.py
58 lines (42 loc) · 1.71 KB
/
edge_fix.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from os import listdir, remove
from os.path import exists, isdir
EDGE = "C:/Program Files (x86)/Microsoft/Edge/Application/"
FILES = ["ie_to_edge_bho.dll", "ie_to_edge_bho_64.dll", "ie_to_edge_stub.exe"]
INFO = (
"Author: Forest Jacobsen (https://github.com/ForestJ2)\n"
"""
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
)
def main():
dirs = []
if exists(EDGE) is False or isdir(EDGE) is False:
print(f"[ERROR] folder '{EDGE}' could not be found")
return
print(f"[INFO] found Edge at '{EDGE}'")
dirs = [item for item in listdir(EDGE) if isdir(EDGE + item)]
for directory in dirs:
full_path = EDGE + directory + "/BHO/"
if exists(full_path):
print(f"[INFO] found path '{full_path}'")
remove_bad_software(full_path)
input("\nPress Enter to exit...")
def remove_bad_software(directory):
for f in FILES:
file_path = directory + f
try:
if exists(file_path):
remove(file_path)
print(f"[INFO] deleted file '{file_path}'")
except Exception as e:
print(f"[ERROR] could not delete '{file_path}', it may not exist")
print(f"[DEBUG] {e}")
if __name__ == "__main__":
print(INFO)
main()