How do I write batch file to delete thousands of files

drew1000

New member
Member
Local time
10:34 PM
Messages
34
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 Computer My Computer

At a glance

W7Intel Quad 96004GBATI Radeon HD2600
OS
W7
CPU
Intel Quad 9600
Motherboard
Asus
Memory
4GB
Graphics Card(s)
ATI Radeon HD2600
Monitor(s) Displays
NEC 18 inch LCD
Hard Drives
Samsung
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 Computer My Computer

At a glance

Windows 7 Professional 32-bit (6.1, Build 7600)4096MB RAMRadeon ATI HD4870
Computer Manufacturer/Model Number
Hewlett-Packard
OS
Windows 7 Professional 32-bit (6.1, Build 7600)
Memory
4096MB RAM
Graphics Card(s)
Radeon ATI HD4870
Monitor(s) Displays
NVIDIA GeForce GT220
Screen Resolution
1680 x 1050
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 Computer My Computer

At a glance

Windows 7 Home Premium 64bit (O.E.M)Intel Core i7 2630QM @2.00GHz6GB DDR3Intel Intergrated Graphics 3000, nVidia GT525...
Computer Manufacturer/Model Number
Dell XPS 15 L502x
OS
Windows 7 Home Premium 64bit (O.E.M)
CPU
Intel Core i7 2630QM @2.00GHz
Memory
6GB DDR3
Graphics Card(s)
Intel Intergrated Graphics 3000, nVidia GT525M (1GB)
Screen Resolution
1366x768
Hard Drives
750GB Seagate 7200rpm
Keyboard
Backlit Dell XPS 15 L502x Keyboard
Mouse
Microsoft Wireless Mobile Mouse 4000
Internet Speed
2.5 Mb/s down, 0.36 up
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 Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
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 Computer My Computer

At a glance

W7Intel Quad 96004GBATI Radeon HD2600
OS
W7
CPU
Intel Quad 9600
Motherboard
Asus
Memory
4GB
Graphics Card(s)
ATI Radeon HD2600
Monitor(s) Displays
NEC 18 inch LCD
Hard Drives
Samsung
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 Computer My Computer

At a glance

Windows 7 Home Premium 64bit (O.E.M)Intel Core i7 2630QM @2.00GHz6GB DDR3Intel Intergrated Graphics 3000, nVidia GT525...
Computer Manufacturer/Model Number
Dell XPS 15 L502x
OS
Windows 7 Home Premium 64bit (O.E.M)
CPU
Intel Core i7 2630QM @2.00GHz
Memory
6GB DDR3
Graphics Card(s)
Intel Intergrated Graphics 3000, nVidia GT525M (1GB)
Screen Resolution
1366x768
Hard Drives
750GB Seagate 7200rpm
Keyboard
Backlit Dell XPS 15 L502x Keyboard
Mouse
Microsoft Wireless Mobile Mouse 4000
Internet Speed
2.5 Mb/s down, 0.36 up
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 Computer My Computer

At a glance

Windows 7 Ultimate 64bit
OS
Windows 7 Ultimate 64bit
Back
Top