Can you help me on how to make this script work.
For Defrag
import os;
defragmentation=os.popen('defrag.exe /C').read()
print(defragmentation);
For Disk Clean up
import os;
clean=os.popen('cleanmgr.exe /sagerun:1').read()
print(clean);
Upon trying this scripts, it didnt do anything and no error message prompt. Thank you.
defrag.exeorcleanmgr.exeare not in yourpath, they won't execute and you won't get an error messageIf you want to find the the correct full path of your executable, you can use the following script: