Windows 7 Forums


Windows 7: How do I write batch file to delete thousands of files

16 May 2012   #1

 
 
How do I write batch file to delete thousands of files

Was infected by the matsnu1 virus recently which encrypes and locks all your data files. Got all my files back by running matsnu1decryp.exe You need an original clean file before the virus struck for it to work out how to decrypt all your other files does does save the day. Down side is that you end up with two files. The the original and a locked version. You can just go through your hard drive and delete the locked files but I have a 1TB disk with thousands of files and folders. Since all the locked files begin with "locked" I was wondering about some sort of batch file that would do this for all folders and sub folders. I am sure I remember doing this stuff years ago with DOS but don't remember enough to try it. Grateful if anyone could let me know the DOS command for this or some other way of quickly deleting many files which have part of the name which is common to all files. They all have different extensions so cannot use that option. My drive is H:



Regards
My System SpecsSystem Spec

16 May 2012   #2

Windows 7 Professional 32-bit (6.1, Build 7600)
Canberra, ACT
 
 

At this time there is a lot of tutorials to do *Batch files. I recommend looking at Batch File Help and Batch File Commands to try to do do this. But to delete thousands of files, you can just go to your computer security (such as NOD32 Antivirus) and clean the hard drive of the files. It worked for me when I last had that blasted virus (which was a while back). If you still have problems, contact me again and I'll try to help.
My System SpecsSystem Spec
19 May 2012   #3

Windows 7 Home Premium 64bit (O.E.M)
 
 

You could probably do this with a search. Open up the H drive and type into the windows search box the word locked. Wait a while and are if anything comes up. It might not but it's worth a try.

Stephen
My System SpecsSystem Spec
.


19 May 2012   #4

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Earth - I wish I was on Risa
 
 

Quote   Quote: Originally Posted by Tekno Venus View Post
You could probably do this with a search. Open up the H drive and type into the windows search box the word locked. Wait a while and are if anything comes up. It might not but it's worth a try.

Stephen
+1
My System SpecsSystem Spec
20 May 2012   #5

 
 

Thanks for the advice guys. I used the search facility with a couple of wildcards. I used *locked*.* and this did the trick. 13800 files so glad I did not have to find them manually. Thanks to all who helped me solve this issue. Now back up and running as normal.
My System SpecsSystem Spec
20 May 2012   #6

Windows 7 Home Premium 64bit (O.E.M)
 
 

Quote   Quote: Originally Posted by drew1000 View Post
Thanks for the advice guys. I used the search facility with a couple of wildcards. I used *locked*.* and this did the trick. 13800 files so glad I did not have to find them manually. Thanks to all who helped me solve this issue. Now back up and running as normal.
Glad you got it sorted. It feels good when I can help someone.
My System SpecsSystem Spec
21 May 2012   #7

Windows 7 Ultimate 64bit
London, UK
 
 

Quote   Quote: Originally Posted by drew1000 View Post
Thanks for the advice guys. I used the search facility with a couple of wildcards. I used *locked*.* and this did the trick. 13800 files so glad I did not have to find them manually. Thanks to all who helped me solve this issue. Now back up and running as normal.
Hi Drew I know you have it sorted now, but you may want to check out a really nifty little program called Everything!

The fastest file finding tool I have ever known

Everything Search Engine

Hope it helps others in the future....
My System SpecsSystem Spec
Reply

 How do I write batch file to delete thousands of files problems?



Thread Tools



Similar help and support threads for: How do I write batch file to delete thousands of files
Thread Forum
Serial read/write in batch file? General Discussion
I want to write a batch file to get the DNS numbers behind a router. Network & Sharing
How to create a batch file that will move files based on the file type General Discussion
Quickly delete thousands of large files Performance & Maintenance


All times are GMT -5. The time now is 05:03 AM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32