-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.py
26 lines (25 loc) · 1014 Bytes
/
uninstall.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
import winshell
import os, shutil
user = os.getlogin()
folder = fr'C:\Users\{user}\AppData\Roaming\hembrev'
for filename in os.listdir(folder):
file_path = os.path.join(folder, filename)
try:
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
folder = fr'C:/Users/{user}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/hembrev'
for filename in os.listdir(folder):
file_path = os.path.join(folder, filename)
try:
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
desktop = winshell.desktop()
input("Avinstallering klar tryck på enter för att stänga: ")