Skip to main content

Deleting a virus via DOS


1. locate the directory or drive:
2. Find a file extension in a directory:
3. Delete files with a particular extension:

1. locate the directory or drive:
 cd <path of the folder/drive>
or 
<drive letter>:

for eg my virus is located in D drive, type:
cd windows/system32

for eg my virus is located in D drive, type:
D:

2. Find a file extension in a directory:
       dir *.<ext> (restricted to a particular directory)
         or
       dir *.<ext> /s /p  (all files in folders and subfolders of a particular extension(drive):

The /s option directs a search of all folders on the hard drive;
 the /p option pauses the display after each screen of text. Double-check everything
<ext> extension

for eg. you have to find all files(viruses) having extension .inf,  type:
      dir *.inf /s /p


3. Delete files with a particular extension:
        Del *.<ext> (restricted to a particular directory)
         or
     Erase /s/q *.<ext> 

for eg. you have to delete all files(viruses) having extension .inf,  type:
   Erase /s/q *.inf

Comments