The Command Prompt is one of the most unique tools in Windows and in any other OS that can be used to do a ton of stuff that cannot be normally done otherwise. This also includes protecting your computer from viruses and malware. Want to know how? Read on.
Please do note that Command Prompt is no substitute for an antivirus program. This post tells you how it can be used to bring out hidden viruses in your computer. If you do this every time you connect a removable media to your computer, you can ensure you won't get infected that way. But apart from that, an antivirus program is still the best.
Autorun is your enemy!
"autorun.inf" is one of the most common viruses found in pendrives that can infect your computer when you open the contents of the pendrive. Most systems come with AutoPlay on by default. Turning it off is one the first things you should do after installing a new OS.
To turn off AutoPlay, go to Control Panel --> Hardware and Sound --> AutoPlay and uncheck the "Use AutoPlay for all media and devices" option.
Time to summon up Command Prompt for some disinfection!
For the following steps, I have a removable USB storage device inserted into my computer with a dummy virus and is recognized as drive F.
Open Command Prompt in any way you want. I prefer to do it by simply typing "cmd" from windows start screen screen and pressing enter (as I have Windows 8.). You can also open it by opening run by pressing start key + r, typing in "cmd" and pressing enter.
Now shift the directory into the storage device by entering the corresponding drive name followed by a colon ( : ) and pressing enter. So, for me, it will be f: .
Time to reveal everything inside.
Type in "attrib -h -r -a -s"
This will make all read only, system, archive and hidden files visible by removing these attributes.
Then, type "dir" to get a list of all files in the storage device.
Look at the list carefully and find out if there is any suspicious file. Any file that you are not expecting to see will probably be a virus (Especially if it has a .inf or .exe extension).
If you find such suspicious files, type "del" followed by the filename and extension.
In the above picture, my pendrive contains an autorun.inf file. So I delete it using "del autorun.inf".
After you have finished going through the files and deleting all such suspicious files, you can open the pendrive safely and do whatever you want.
Note: All viruses can also be detected and deleted by scanning the drive with a good up-to-date antivirus program.
That's about it! I hope this article was helpful!
Please do note that Command Prompt is no substitute for an antivirus program. This post tells you how it can be used to bring out hidden viruses in your computer. If you do this every time you connect a removable media to your computer, you can ensure you won't get infected that way. But apart from that, an antivirus program is still the best.
Autorun is your enemy!
"autorun.inf" is one of the most common viruses found in pendrives that can infect your computer when you open the contents of the pendrive. Most systems come with AutoPlay on by default. Turning it off is one the first things you should do after installing a new OS.
To turn off AutoPlay, go to Control Panel --> Hardware and Sound --> AutoPlay and uncheck the "Use AutoPlay for all media and devices" option.
Time to summon up Command Prompt for some disinfection!
For the following steps, I have a removable USB storage device inserted into my computer with a dummy virus and is recognized as drive F.
Open Command Prompt in any way you want. I prefer to do it by simply typing "cmd" from windows start screen screen and pressing enter (as I have Windows 8.). You can also open it by opening run by pressing start key + r, typing in "cmd" and pressing enter.
Now shift the directory into the storage device by entering the corresponding drive name followed by a colon ( : ) and pressing enter. So, for me, it will be f: .
Time to reveal everything inside.
Type in "attrib -h -r -a -s"
This will make all read only, system, archive and hidden files visible by removing these attributes.
Then, type "dir" to get a list of all files in the storage device.
Look at the list carefully and find out if there is any suspicious file. Any file that you are not expecting to see will probably be a virus (Especially if it has a .inf or .exe extension).
If you find such suspicious files, type "del" followed by the filename and extension.
In the above picture, my pendrive contains an autorun.inf file. So I delete it using "del autorun.inf".
After you have finished going through the files and deleting all such suspicious files, you can open the pendrive safely and do whatever you want.
Note: All viruses can also be detected and deleted by scanning the drive with a good up-to-date antivirus program.
That's about it! I hope this article was helpful!