RDR-IT - Tutorials - Windows Server - General - Vbs : delete all files with the same extension in a folderVbs : delete all files with the same extension in a folder 1 April 2021 - 1 March 2025 - Romain - (0) - 1 minute The next two lines of code allow you to delete all files with a particular extension in a folder. Set obj = CreateObject("Scripting.FileSystemObject") obj.DeleteFile("C:\Windows\*.log")The example below will delete all of the .log files from the C:\Windows folder.Vbs : delete files by extension in folder General , Scripts Files , vbs Related Posts PowerShell: automatically delete files older than X days FOG agent installation script SSH client: delete existing keys