>>591 VBSだけど、こんな感じでいいのかな?
参考にしてみてください。以下をコピーして
delete.vbs として保存。ダブルクリックする。
邪魔くさいファイルを削除して、対象ファイルのパスを
C:\log.txt に書き出します。

使用はくれぐれも自己責任でお願いします。
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
コードの意味が分からなければ使用しないほうが
良いと思います。

'ここから--------------------------------------------------
'**Start Encode**

Dim FSO, TXT
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TXT = FSO.CreateTextFile("C:\log.txt", True)
Call ShowFileList("C:\", FSO, TXT)
TXT.Close
MsgBox "complete"

Sub ShowFileList(folderspec, fso, txt)
    Dim f, g, f1, f2, fc, fd
    
    On Error Resume Next

    Set f = fso.GetFolder(folderspec)
    Set fc = f.Files
    Set fd = f.SubFolders
    For Each f1 in fc
        If InStr(1, LCase(f1.Name), ".com") <> 0 Or _
           InStr(1, LCase(f1.Name), ".exe") <> 0 Or _
           InStr(1, LCase(f1.Name), ".bat") <> 0 Or _
           InStr(1, LCase(f1.Name), ".sys") <> 0 then
            txt.WriteLine(f1.Path & "\" &  f1.Name)
            Set g = fso.GetFile(f1.Path & "\" &  f1.Name)
                g.Delete
            Set g = Nothing
        End If
    Next
    For Each f2 in fd
        txt.WriteLine(f2.Path & "\")
        Call ShowFileList(f2.Path & "\", FSO, TXT)
    Next
End Sub
'ここまで--------------------------------------------------