To delete junk files from your computer using Command Prompt, you need to run more than one command. For example, you can use the cleanmgr /sagerun command to delete files automatically. On the other hand, defrag c: command will run the defragmentation tool on your computer. Whether you use Windows 11 or Windows 10, the chain of commands is the same.