-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleaner.py
More file actions
34 lines (25 loc) · 704 Bytes
/
cleaner.py
File metadata and controls
34 lines (25 loc) · 704 Bytes
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
from time import sleep
from os import path, listdir, remove, getenv
import pyuac
def main():
timeset = input("Clean every _ minutes: ")
if timeset.isnumeric() and timeset.split():
while True:
clean()
sleep(timeset * 10000)
else:
main()
def clean():
homedir = path.expanduser('~')
cleanlist = ['C:\Windows\Temp', path.join(getenv('LOCALAPPDATA'),'Temp'), path.join(homedir, 'Recent')]
m = []
for i in cleanlist:
for j in listdir(i):
m.append(m)
print(m)
if __name__ == '__main__':
if not pyuac.isUserAdmin():
print('Relaunching as ADMIN...')
pyuac.runAsAdmin()
else:
main()