Batch to find / delete files except one?

August 26, 2009 at 12:23:44
Specs: Windows XP Pro SP3
I'm trying to find a way to more quickly search through a stack of laptops and delete some troublesome copies of wmiprvse.exe, though it's not looking too hard to just delete them all, I really need it to exclude the original found in C:\Windows\system32\wbem. I'm far too much of a code novice to even imagine how to exclude a specific file from such a broad search and destroy command.. Anyone who can spare some time to help?

See More: Batch to find / delete files except one?

Report •

August 26, 2009 at 17:57:58
This might help...

for /f "delims=" %%a in ('dir /b /s c:\wmiprvse.exe ^| find /i /v "C:\Windows\system32\wbem\wmiprvse.exe"') do (
echo %%a

Report •
Related Solutions

Ask Question