Remove Virus From Any Drive Using Command Prompt (CMD) In Windows 10
How To Remove Virus From Any Drive Using Command Prompt (CMD) In Windows 10 ?
a virus is a self- replicating computer program that infects your computer. These viruses are a menace and can spread across multiple computers via USB/flash drives, external media and other means. As we all know, there is a multitude of anti-virus software. To our dismay, not all of them can do the trick. Sometimes, even your antivirus can fail to detect some sort of viruses. Well, in such case, CMD prompt may be the solution to help you solve the virus issues. Most of us grapple with viruses like Autorun.inf, newfolder.exe, ravmon.exe, svchost.exe etc. They usually present themselves as files and sometimes they can even be files hidden from you.To remove a virus using CMD, we shall use a CMD known as “attrib” command.
Here we have the “attrib” syntax ATTRIB{+attribute/-attribute}{pathname}[/S[/D]}
And with the above command there are different parameters and switches so lets see what they are.
+/- to enact or to cancel the specified attribute.
D include any process folder.
S searching through the entire path. Sub-folders inclusive.
Pathname path where target folder is located.
This here is the proper syntax for the attribute command:
ATTRIB{+R/-R}{+A/-A}{+S/-S}{+H/-H}{+I/-I}{drive:}{path}{/S[/D][/L]}
After knowing all of the basics, now let’s give it a shot and try to see how we can remove a virus from USB, SD card etc. using CMD prompt.
For example, let’s transfer an autorun.inf virus from my USB to my D drive and delete the virus from the D drive.
Step 1: Open command prompt from search and run as administrator.
Step 2: Type D and hit enter
Step 3: Type “attrib” and press enter. This command lists out all files inside the current drive and you will clearly see autorun.inf virus listed.
Step 4: At this stage to remove the virus using CMD, type into command prompt “attrib –r –a –s –h *.* “ And press enter. This in turn will remove the read only, archive, system and hidden file attribute from all the files.
-r is for removing read only files
-a is for removing the archive file
-s is for removing system file
-h is for removing hidden file
*.* is for files with all different types of file extensions.
Keep in mind that this command only removes the different attributes from different files. However, the files will still exist. And therefore we must delete the virus permanently. To delete the virus, type “delete autorun.inf” and press enter. The file will get deleted from the current drive immediately.
Step 5: Type "autorun.inf" and hit enter, If it shows File not found which means your system is clean.
Job Done!!!
Comments
Post a Comment