Clear, practical technology insights About · Contact

How to Remove a Virus Using Cmd

It is common these days to lose your data due to virus affecting you flash drives, memory cards etc. The virus can be removed and the data can be recovered easily by using the command prompt. Just follow the simple steps. Open the drive...

Author: Kareem Winters2 minutes read
Table of Contents
Part 1 of 2:

Making sure the data can be recovered

  1. images 1 of How to Remove a Virus Using Cmd
    Open the drive that contains the virus.
  2. images 1 of How to Remove a Virus Using Cmd
    Press Ctrl+A to select all.
  3. images 1 of How to Remove a Virus Using Cmd
    Hit Alt+Enter to view properties.
  4. images 1 of How to Remove a Virus Using Cmd
    Note the total space consumed by the data of the drive.
  5. images 1 of How to Remove a Virus Using Cmd
    Compare it to the used space of the drive. If the used space exceeds the total size of the data, then it is possible to recover the lost data.
    1. In other words, if the drive is showing more space consumed than the actual data inside the drive, then your lost data can be recovered.
Part 2 of 2:

Removing virus and recovering data through cmd

  1. images 1 of How to Remove a Virus Using Cmd
    Press Ctrl+R at the desktop.
  2. images 1 of How to Remove a Virus Using Cmd
    Type cmd and hit Enter.
  3. images 1 of How to Remove a Virus Using Cmd
    Type the command:    attrib -a -r -h -s /s /d x:*.*
  4. Replace x with the drive letter and hit Enter.
    images 1 of How to Remove a Virus Using Cmd
    1. The drive will now contain a folder without any name. This folder contains your lost data.
  5. images 1 of How to Remove a Virus Using Cmd
    Delete any unnecessary files that you see such as autorun.inf, recycle.bin etc.
  6. images 1 of How to Remove a Virus Using Cmd
    Backup your data and format the drive, if possible.

Was this article helpful?

Your feedback helps us improve.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.