I had an odd problem today with a USB barcode scanner and its OPOS driver. The scanner in question is a DataLogic 2200VS USB scanner and I’m using its OPOS Driver (USBScanner is the OPOS Device name) on a Windows Vista machine with UAC switched on.
When I lauched the application I was running it kept giving a error when it tried to open the device “Load Datalogic Scanner XML Settings Failure!” No amount of searching online was able to reveal the answer to this error and because its load via the OPOS control which is in my application via COM.Interop there is no easy way to step into the code and see why its going wrong.
After a little testing and debugging I discovered that it works if the application is “Run As Administrator” it’ll work fine so it had to be a permission problem just wasn’t sure which permissions were wrong.
If only there was a way to see which files and registry entries the driver was trying to access and which failed because of a access denied error… Thats where this cool tool called Process Monitor comes in. Lauching the app it’ll show you everything going on in your system, a few quick filters so that it only shows my apps calls then tried to use the scanner, it gave the error again but this time I could track down the cause.
It turned out that it was trying to write to the C:\Program Files\DLSOPOS\ folder and was failing and was trying to access these 2 parts of the registry and getting access denied errors.
HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS\Scanner\USBScanner and HKEY_LOCAL_MACHINE\SOFTWARE\DATALOGIC\DL_OPOS_Service
Changing the permissions on those registry keys and the folder fixed the problem.