Batch script to set the A1 button actions on a FZ-G1 Toughpad tablet

By | December 14, 2016
Share

Here is the batch, it’s fairly self-explanatory:

rem import default user's hive
reg load HKLM\ImportedHive "%SystemDrive%\Users\Default\NTUSER.DAT"

rem create batch that will be called by A1 button
echo "%ProgramFiles(x86)%\Panasonic\PCam\PCam.exe">%WinDir%\System32\A1Click_Mapping.bat
echo "%ProgramFiles(x86)%\Panasonic\TSModSel\tsmodsel.exe" -G>%WinDir%\System32\A1Hold_Mapping.bat

rem ties A1 to cmd.exe /c %WinDir%\System32\A1Click_Mapping.bat and A1Hold_Mapping.bat for the DEFAULT USER
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0" /v "ButtonID" /t REG_DWORD /d "2" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKLM\ImportedHive\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f

rem ties A1 to cmd.exe /c %WinDir%\System32\A1Click_Mapping.bat and A1Hold_Mapping.bat for the CURRENT USER
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0" /v "ButtonID" /t REG_DWORD /d "2" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryLandscape" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\PrimaryPortrait" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryLandscape" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310043006c00690063006b005f004d0061007000700069006e0067002e0062006100740022000000" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefHoldAction" /t REG_DWORD /d "2147483648" /f
Reg.exe add "HKCU\Control Panel\TabletPC\ButtonMaps\0\SecondaryPortrait" /v "DefHoldActionData" /t REG_BINARY /d "2500530079007300740065006d0052006f006f00740025005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000002f0063002000220043003a005c00770069006e0064006f00770073005c00730079007300740065006d00330032005c004100310048006f006c0064005f004d0061007000700069006e0067002e0062006100740022000000" /f

rem unload default user's hive
reg unload HKLM\ImportedHive

 

One thought on “Batch script to set the A1 button actions on a FZ-G1 Toughpad tablet

  1. LS

    Hey Brian, thanks for this! I can see the registry writing properly, however when testing on a Win10 enterprise build, the A1 button seems to ignore the registry key and defaults to launching “C:\WINDOWS\System32\control.exe /name Microsoft.TabletPCSettings /page 1”. I re-imported the hive and can successfully see the changes, however until I actually browse to a exe or bat file with the browse button in the TabletPCSettings, the A1 button does not launch the app selected in the registry.

    The OEM OOB for this FZ-G1 is set to C:\WINDOWS\explorer.exe “shell:AppsFolder\PanasonicCorporation.PanasonicPCSettingsUtility_eewqyxmkz9mn0!PanasonicCorporation.PanasonicPCSettingsUtility” and seems to work seamlessly… do you know if there’s another setting somewhere else that I’m missing? I’d like to set this for the default user profile. Thanks again!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.