Please Help! Creating Batch file to delete virus.

October 22, 2012 at 11:37:43
Specs: Windows 7

I need help to write batch script to searce all drive for multi folder and delete all files in that folder.



I want to do this after i have start a windows 7 repair from a USB stick and in the command promt i will launch this batch file. Is this posible? Please help me!

See More: Please Help! Creating Batch file to delete virus.

Report •

October 22, 2012 at 14:04:57
I'm just curious why don't you use a program that removes the folder of the viruses. I use Malewarebytes and that usually take care of the registry and folders as well all the files associated to the virus.

Report •

October 22, 2012 at 17:50:02
first, for one drive:
::===== begin
@(for /f "tokens=*" %%a in ('dir /a:d /s /b c:\windows\program\s---folder*') do
rd /s /q "%%a")
::===== end

niether tested nor UL approved. Limited in-house testing seemed to work.

Report •

October 23, 2012 at 12:07:41
Yes you can use Malewarebytes. But i just want to learn how to it. So i can pick what folder to scan.


Report •

Related Solutions

October 23, 2012 at 12:15:00
::===== begin
@(for /f "tokens=*" %%a in ('dir /a:d /s /b c:\pictures*') do
rd /s /q "%%a")
::===== end

i copy that but it doest not work?

Report •

October 23, 2012 at 16:57:28
"pictures*" is a series of targets off the root? (like c:\pictures1\, c\pictures.zzz\ etc) and all directories and not files, correct? If so, it should work, it worked on my test rig. You might post a short directory listing of what you want to work with, and the results of the for-loop (put "echo " in front of "rd /s /q", like so:
for... ... do echo rd /s /q "%%a")

Report •

Ask Question