This sniplet was written to work within a Powershell app deploy toolkit package. If you are not familiar with that toolkit, get familiar with it, its a huge time saver.
## <Perform Installation tasks here> Execute-Process -Path "$envSystem32Directory\reg.exe" -Parameters ('load HKLM\ImportedHive "{0}\Users\Default\NTUSER.dat"' -f $envSystemDrive) $bClickDefAction = [byte[]](0x25,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,0x52,0x00,0x6f,0x00,0x6f,0x00,0x74,0x00,0x25,0x00,0x5c,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,0x33,0x00,0x32,0x00,0x5c,0x00,0x72,0x00,0x75,0x00,0x6e,0x00,0x64,0x00,0x6c,0x00,0x6c,0x00,0x33,0x00,0x32,0x00,0x2e,0x00,0x65,0x00,0x78,0x00,0x65,0x00,0x00,0x00,0x63,0x00,0x66,0x00,0x67,0x00,0x6d,0x00,0x67,0x00,0x72,0x00,0x33,0x00,0x32,0x00,0x2e,0x00,0x64,0x00,0x6c,0x00,0x6c,0x00,0x2c,0x00,0x43,0x00,0x4d,0x00,0x5f,0x00,0x52,0x00,0x65,0x00,0x71,0x00,0x75,0x00,0x65,0x00,0x73,0x00,0x74,0x00,0x5f,0x00,0x45,0x00,0x6a,0x00,0x65,0x00,0x63,0x00,0x74,0x00,0x5f,0x00,0x50,0x00,0x43,0x00,0x00,0x00) Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2' -Name 'ButtonID' -Type 'Dword' -Value '2' Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\ImportedHive\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2' -Name 'ButtonID' -Type 'Dword' -Value '2' Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\PrimaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryLandscape' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefAction' -Type 'Dword' -Value '2147483648' Set-RegistryKey -Key 'HKEY_CURRENT_USER\Control Panel\TabletPC\ButtonMaps\2\SecondaryPortrait' -Name 'DefActionData' -Type 'Binary' -Value $bClickDefAction Execute-Process -Path "$envSystem32Directory\reg.exe" -Parameters 'unload HKLM\ImportedHive'
What would I need to change to map to A2 (since our A1 is hard-mapped to the barcode scanner)?
Thanks!
Tim, Same process as A1. Are you having trouble with it not working?