If you are using Windows Vista or Windows 7, you can directly use the Group Policy Function to reject installation of unfamiliar USB devices. The following uses Windows 7 as an example:
Step 1: insert your USB device into your computer, and open the control panel, hardware, sound, device, and printer when all USB devices are working normally, in the window that appears, you can see all devices currently connected to the system.
Right-click a USB device and select properties. In the displayed window, select Hardware/properties, select details, and select hardware ID in the property list.CodeCopy and save it to a temporary notepad file.
Step 2: Open Control Panel \ hardware & sound \ Device Manager in Control Panel, expand the general serial bus controller list in Device Manager, and find the USB large capacity storage device, click the Details tab in the Properties window, copy the hardware ID, and save it to the temporary text.
Step 3: Press win + R to open the run dialog box and enter gpedit. MSC opens the Group Policy window, expands the computer configuration/management template/system/device installation restrictions, and double-click on the right to allow the installation of devices that match the following device IDs, in the displayed window, select Enabled, Click Show, and paste the previously recorded device IDs one by one.
Then, double-click to disable installation of devices that are not described by other policies. In the displayed window, select Enabled and click OK.