Cleans your temp
and %temp%
directories.
Windows Defender complains about "Critical threat" and "Trojan" because the application gets the ability to do anything with a folder that requires administrator rights without running the program as an administrator. The corresponding function is:
def change_permissions(path):
try:
current_permissions = os.stat(path).st_mode
if not (current_permissions & stat.S_IRWXU):
_log.log(logging.INFO, f"Changing permissions for {cut_path(path)}.")
new_permissions = current_permissions | stat.S_IRWXU
os.chmod(path, new_permissions)
_log.log(logging.INFO, f"{cut_path(path)}: 1000")
else:
_log.log(logging.INFO, f"{cut_path(path)}: 1500")
except Exception as e:
_log.log(logging.ERROR, f"{cut_path(path)}: {e}")
print(f"Error when changing permissions for {cut_path(path)}: {e}")
Defender sees this and does not allow the program to run.
.log file is located in: C:\Users\user\AppData\Roaming\TempCleaner\main.log
If you want to analyze .log file yourself, codes here:
- 1000 - changing permissions for path successful
- 1500 - permissions for path are already set correctly
- 2000 - file is occupied by another program
- 2500 - no access to directory
You can see the prefixes in the version name.
All prefixes list:
-RX0
- release version;-PRX0
- pre-release version;-BX0
- beta version;-AX0
- alpha version;-FX0
- only for first-first testers(usually the lead developer).