How to avoid getting any virus, worm, or trojan through any USB stick/USB drive on your Windows 10 PC/laptop with these Windows Registry settings
USB stick or USB drive is one of the easiest ways to get your Windows 10 PC/laptop infected with a trojan or a virus. Very often we plug in a USB stick from our friends/colleagues without knowing whether it contains viruses, malware, trojan, etc. At that point in time, we don’t have time or resources to check the USB stick for viruses and ultimately our PC/laptop is infected with some virus or trojan.
If you read news reports online, you will find that the USB flash drive or USB stick is one of the most favored threat vectors infecting PCs and laptops with information-stealing trojans, keyloggers, and other dreaded malware.
In this article, we are going to explain how you can completely avoid getting infected by trojans, worms, and viruses on any USB stick or Flash Drive you use to connect your Windows 10 PC/laptop.
There two ways in which you can set up your Windows 10 PC/laptop to completely avoid getting infected by any virus on a connected USB stick.
Go to your search window in the bottom left of your monitor and type in Regedit. It will show Registry Editor. You can also press the Windows + R key combination and type regedit . Once you have opened the Registry Editor, go to the following path :
HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control.
Right Click on Control and select new key. Name the new key as StorageDevicePolicies . It will appear in the right dashboard of the Registry Editor. Right click it with your mouse and select New, DWORD (32-bit) and give it the name WriteProtect .
Once this is done, double click on WriteProtect to edit its properties and give it the value of 1. Accept all the changes and restart the computer for the changes to take effect. Next time any USB stick is connected to your PC/laptop, it cant read/write to your PC/laptop thereby removing any chances of virus infection.
Windows Group Policy
You may not know this but Windows Group Policy is a great way to stop your Windows 10 PC/laptop from ever getting infected with a virus/trojan through a connected USB stick. However, there is a catch. The Windows Group Policy Editor is only available for Windows 10 Enterprise and Business version. If you have a Windows 10 Home version, you can try the Registry Edit version above.
Here is how you can use the Windows Group Policy to prevent your computer or laptop from reading/writing from any USB stick/USB flash drive.
In the start button, type Group Policy and access the editor. You can also just press the Windows + R key combination and run gpedit.msc in the window. In the Group Policy Editor, go to Computer Configuration, Administrative Templates, System, and Removable Storage Access.
There you can see multiple options and the one that interests us is the one indicated by Removable disks: deny write access. Double-click on that option. By default, it will be Not configured. You should enable this option and accept it on the next screen and exit.
Now press Windows+R key and type CMD. At the Command Prompt, type the command gpupdate / force. Now restart your laptop or PC and you are done. Now your laptop/PC will never be infected with a virus through USB Stick or USB Flash Drive.