A computer virus can appear from anywhere – even from removable storage devices. When an infected USB stick enters your computer, it is activated thanks to a built-in Windows feature called AutoRun.
Fortunately, there is a way to disable this feature.
In this article, we will show you how to remove a virus shortcut using the command line and protect your computer from future attacks.
What is Autoplay?
To understand what a virus shortcut is, you need to know what AutoRun does and why it does it.
Windows runs the autorun.inf file when external devices (USB, memory stick, CDs, DVDs, SD cards) are connected to the computer. Features like AutoRun are designed to improve your PC experience.
In most cases, they help non-technical users by automatically launching applications found on external devices, such as flash drives, instead of forcing them to manually navigate through important files and folders.
– /
The best example is the installation CDs that come with the software you purchase. Most likely, each CD will have an autorun.inf file, so the installer starts as soon as you insert the CD into your computer.
Be sure to read my previous post on the difference between autoplay and autoplay, which are similar but different.
How does shortcut virus work?
Unfortunately, some attackers abused the autoplay feature. Now it is possible to attach a virus to autorun.inf from a USB stick so that both run at the same time. This means that you essentially install the virus as soon as you plug in the USB stick.
What a virus does will depend on what it has been programmed for. Some are known to add a so-called keylogger to your system. This will allow hackers to track keystrokes to steal personal information such as passwords and banking information.
Disable AutoRun
While AutoRun is a great feature, disabling it might be the best way to prevent infected autorun.inf files from getting corrupted.
Here are the steps you should follow to disable Windows autostart:
Select Settings (Windows + I) Devices AutoPlay.
Disable autostart by setting the switch to the “Off” position.
Note. You can also use the dropdown menu to select the default action when you insert an external device.
Delete the Autorun.inf file
If you suspect there is a virus on your USB drive, deleting the autorun.inf file will prevent the virus from running.
Delete with CMD
Delete using CMD
Here’s how to remove the autorun.inf file by running CMD, also known as command line:
Open Run and type CMD to open a command prompt.
Enter the USB drive letter (example: “G:” or “F:” without quotes) and press Enter.
Type ATTRIBUTE -H -R -S AUTORUN.INF at the command line and press Enter.
Type DEL AUTORUN.INF and press Enter.
Uninstall using Windows Explorer
Delete using Windows Explorer
Here’s how to delete the autorun.inf file using Windows Explorer:
Start Windows Explorer (Windows + E).
Open your USB drive on the left side panel. This action will show you the contents of the USB stick.
Select autorun.inf from the list and click Remove.
Note. Autorun.inf is usually a hidden file. Make sure you have the Show hidden files option enabled. To do this, go to the “View” section and check the “Hidden items” box.
Deleting the autorun.inf file using any of the methods should protect your computer from malicious viruses. However, you should use antivirus software to scan your USB drive for malware immediately afterward as an added security measure.
–