It has been a while since I've come back due to other projects but I can confirm that the System32\drivers\\ with double \\ is on my build as well for the below keys and removing "System32\drivers\" resolves the issue for USB items not being detected properly. I can now hopefully get rid of my custom Hardware change detection script that I had developed to get around this issue.
Keys impacted on my build with the added System32\drivers\ in front of the ImagePath:
I got the same issue this week.
I'm using the latest Win10PE scripts with a 1709-Source.
The first time the USB flash drive is connect, it gets correctly connected and gets a drive letter.
But this won't work a second time (unless another USB flash drive keeps connected).
The error was not affected by the user account (SYSTEM / Administrator). The behavior of the USB flash drives was the same (that they only work at the first time).
The solution for me was:
There is a wrong path to the USBSTOR.SYS in the registry (Entry "ImagePath" in the key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR").
The correct registry entry should be: \SystemRoot\System32\drivers\USBSTOR.SYS
But it actually is: System32\drivers\\SystemRoot\System32\drivers\USBSTOR.SYS
The reg-file with the correct entry is attached.
The content of the reg-file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\USBSTOR]
"ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
74,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\
00,69,00,76,00,65,00,72,00,73,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,00,\
52,00,2e,00,53,00,59,00,53,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
74,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\
00,69,00,76,00,65,00,72,00,73,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,00,\
52,00,2e,00,53,00,59,00,53,00,00,00