Windows: starting Chrome in full-screen kiosk mode from a batch file
Posted by jpluimers on 2021/08/03
When configuring a web-based kiosk for someone with Alzheimer’s disease, I wanted to start Chrome in full-screen kiosk mode.
Chrome full-screen kiosk mode
The secret for full-screen kiosk mode is to pass the -start-fullscreen
command-line option. Thanks [WayBack] User ginomay89 – Super User for answering that in [WayBack] tablet – How to set Google Chrome to automatically open up and in full screen – Super User.
Finding chrome
At first I thought about differentiating on the chrome.exe location that you can find in the registry. This turned out to be depending on how you install Chrome:
- locally for the current user by a non-local-administrator user (by default the location is under
%LocalAppData%
) - globally for all users by a local-administratator user (by default is under
%ProgramFiles(x86)%
)
Oddly, there is no way (not even by denying UAC elevation!) for a local administrator to install Chrome for only the current user.
This is odd, as when non-local-administrator denies UAC, the installation is locally to the user.
Then I remembered there are two ways for Windows to find an application
- On the
PATH
- Via the start menu (which includes anything on the
PATH
)- Rob van der Woude explains this works for documents with extensions in [WayBack] Batch files – The START command: Windows NT 4/Windows 2000 Syntax
- I found out this works for plain application names as well; this might be handled through the “
AppUserModelId
” values underHKEY_CLASSES_ROOT
; one day I will further research this through [WayBack] Application User Model IDs (AppUserModelIDs) – Windows applications | Microsoft Docs.
The cool thing is that the start
command does the latter, so I came up with this batch file that starts chrome with the -start-fullscreen
parameter that will initiate kiosk mode with the default chrome settings:
start "Chrome Kiosk Mode" chrome --start-fullscreen
In case I want to compare the registry settings
Basically sorting out the registry settings would mean parsing the references to chrome.exe (often with extra parameters) in the below registry key/value-name pairs.
One day I might need to do this for different reasons, but currently the start
trick suffices.
Installation locally for the user
:: Computer\HKEY_CLASSES_ROOT\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\Application :: ApplicationIcon :: Computer\HKEY_CLASSES_ROOT\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\DefaultIcon :: (Default) :: Computer\HKEY_CLASSES_ROOT\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\shell\open\command :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Classes\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\Application :: ApplicationIcon :: Computer\HKEY_CURRENT_USER\Software\Classes\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\DefaultIcon :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Classes\ChromeHTML.C7I2DUC3GCCQKWDIBUVWGYZAWA\shell\open\command :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\Google Chrome.C7I2DUC3GCCQKWDIBUVWGYZAWA\Capabilities :: ApplicationIcon :: Computer\HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\Google Chrome.C7I2DUC3GCCQKWDIBUVWGYZAWA\DefaultIcon :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\Google Chrome.C7I2DUC3GCCQKWDIBUVWGYZAWA\InstallInfo :: HideIconsCommand :: ReinstallCommand :: ShowIconsCommand :: Computer\HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\Google Chrome.C7I2DUC3GCCQKWDIBUVWGYZAWA\shell\open\command :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Google\Update :: LastInstallerSuccessLaunchCmdLine :: Computer\HKEY_CURRENT_USER\Software\Google\Update\ClientState\{8A69D345-D564-463C-AFF1-A69D9E530F96} :: LastInstallerSuccessLaunchCmdLine :: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe :: (Default) :: Path
Installation globally for all users
:: Computer\HKEY_CLASSES_ROOT\ChromeHTML\Application :: ApplicationIcon :: Computer\HKEY_CLASSES_ROOT\ChromeHTML\DefaultIcon :: (Default) :: Computer\HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command :: (Default) :: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store :: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\Application :: ApplicationIcon :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\DefaultIcon :: (Default) :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command :: (Default) :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\Capabilities :: ApplicationIcon :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Google Chrome\DefaultIcon :: (Default) :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Google Chrome\InstallInfo :: HideIconsCommand :: ReinstallCommand :: ShowIconsCommand :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Google Chrome\shell\open\command :: (Default) :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Google\Update :: LastInstallerSuccessLaunchCmdLine :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Google\Update\ClientState\{8A69D345-D564-463C-AFF1-A69D9E530F96} :: LastInstallerSuccessLaunchCmdLine :: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe :: (Default) :: Path
–jeroen
Leave a Reply