Yes. Previous versions of Windows included the Autorun feature which instantly opened USB drives once they were connected to a PC. This made flash drives instant victims to viruses that were present on a host PC. While the Autorun feature is no longer available for modern versions of Windows, you can transfer viruses to a drive when you manually open a file or folder on the flash drive while it’s connected to an infected PC.