Site icon RDR-IT

Vbs : delete all files with the same extension in a folder

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
Exit mobile version