📎 AI Summary:
The thread discusses how to delete all files in a folder except those containing a specific character ("!") in their filenames. The original poster found a workaround using a free program called Bulk File Manager v1.6. Meanwhile, a contributor suggests using a PowerShell script to accomplish the task, illustrating how to delete files without the "!" in their names. Overall, the discussion provides practical solutions for selectively deleting files based on filename criteria.

Legna

Well-Known Member
Joined
May 5, 2015
Messages
38
Thread Author #1
How do I delete all files except for those who has the [!] in their file names?

EDIT:

Found a workaround. It's a free program called Bulk File Manager v1.6.
 

Last edited:
Solution
You could do it in powershell. Suppose you wanted to delete all items in a folder on your desktop named test_dir that do not have a ! in them.

You could run the following.

Foreach ($file in (Get-ChildItem -Path $env:Userprofile\Desktop\test_dir -Recurse -File -Exclude *!*)) { Remove-Item $file.FullName }

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,995
You could do it in powershell. Suppose you wanted to delete all items in a folder on your desktop named test_dir that do not have a ! in them.

You could run the following.

Foreach ($file in (Get-ChildItem -Path $env:Userprofile\Desktop\test_dir -Recurse -File -Exclude *!*)) { Remove-Item $file.FullName }
 

Solution