1. Home
  2. Windows

Delete Log Files From Windows Directory Using Command Prompt

Many a times after using numerous tools for cleaning clutter from a system, the primary drive still seems to lack free space despite the fact that there is little data saved on it. This is because there are many log files that remain in the Windows directory in the primary drive, which many tools are unable to remove. This command line will help you remove such unnecessary files which will help clear the log files from the Windows directory.

Simply open the command prompt and type cd\ and hit enter. Then type cd windows to select the Windows directory and hit enter again. This will select the appropriate directory and give you the access from the command prompt to delete log files. Now type del *.log /a /s /q /f  and press enter to delete the log files.

All log files will be deleted from the directory. In this command “a” signifies all, whereas “s” deletes files from all sub folders, “q” bars from any prompts to ask for a yes/ no question and “f” forcibly removes the files.

Deleting Files

Being a system administrator, I have used this command line to free as much as 500mb of clutter from systems that had not be formatted for a long period of time. It is worth mentioning here that many cleaning tools had already been used on these systems on a periodic basis including the windows disk cleaner. However, these log files never seemed to be removed until this command was used.

Leave a comment