Disk Defrag and Disk Clean up using Python Script
问题 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. 回答1: If your defrag.exe or cleanmgr.exe are not in your path , they won't execute and you won't get an error message You would need to run the scripts as an administrator to