I would like to know if anyone knows how to make a batch search for a file by name on all local drives and delete it when found, so it is permanently deleted and not just in the recycle bin.
So far I have DEL /S /P "123.MSN" though this doesn’t search beyond the current directory the batch is found in.
You should be able to do this for each drive letter
del C:\123.msn /f /s /qJust replace
C:\with the drive or if unknown you might be able to do this recursively for all drives, see here. This will search the entire drive for the file, and if found, delete.Also, you are using the
/pswitch which will prompt to delete. I wasn’t sure if it was meant to be/qwhich suppresses confirmation. The/fwill delete read only files, and the files won’t go to the recycle bin, they will just be deleted.