├── Scripts ├── Start - Kios - modify path.lnk ├── Kiosk.ps1 └── Move-Window.ps1 └── README.md /Scripts/Start - Kios - modify path.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alex-tomin/Tomin.Tools.KioskMode/HEAD/Scripts/Start - Kios - modify path.lnk -------------------------------------------------------------------------------- /Scripts/Kiosk.ps1: -------------------------------------------------------------------------------- 1 | ###################################################### 2 | ########## Kiosk Mode ############ 3 | ###################################################### 4 | # 5 | # Runs edge in full-screen mode on predefined screens 6 | # ---------------------------------------------------- 7 | 8 | Set-Location $PSScriptRoot 9 | 10 | # Kill all running instances 11 | # &taskkill /im msedge* /F 12 | 13 | start msedge "--new-window https://eng.ms/" -WindowStyle maximized 14 | . .\Move-Window.ps1 -ProcessName msedge -MonitorNum 3 15 | 16 | start msedge "--new-window https://contoso.com" 17 | . .\Move-Window.ps1 -ProcessName msedge -MonitorNum 2 18 | # move first before opening another tab, as the windows needs to be active, 19 | start msedge "https://stackoverflow.com" 20 | 21 | start msedge "--new-window https://contoso.com" 22 | . .\Move-Window.ps1 -ProcessName -MonitorNum 1 23 | -------------------------------------------------------------------------------- /Scripts/Move-Window.ps1: -------------------------------------------------------------------------------- 1 | #------------------------------------ 2 | # Functions Definition 3 | # Do NOT TOUCH this section! 4 | #------------------------------------ 5 | param 6 | ( 7 | [Parameter(Mandatory)] 8 | [string] 9 | $ProcessName, 10 | 11 | [Parameter(Mandatory)] 12 | [Int] 13 | $MonitorNum, 14 | 15 | [Int] 16 | $StartDelay = 1 17 | ) 18 | 19 | Add-Type -assembly System.Windows.Forms 20 | Add-Type -Name WinAPIHelpers -Namespace WinApi -MemberDefinition ' 21 | [DllImport("user32.dll")] 22 | public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int W, int H); 23 | 24 | [DllImport("user32.dll")] 25 | public static extern bool SetForegroundWindow(IntPtr hWnd); 26 | 27 | [DllImport("user32.dll")] 28 | public static extern IntPtr GetWindowText(IntPtr hWnd, System.Text.StringBuilder text, int count); 29 | 30 | [DllImport("user32.dll")] 31 | [return: MarshalAs(UnmanagedType.Bool)] 32 | public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); 33 | 34 | [DllImport("user32.dll")] 35 | public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);' 36 | 37 | $WinAPI = [WinApi.WinAPIHelpers] 38 | $Screen = [System.Windows.Forms.Screen] 39 | $SendKeys = [System.Windows.Forms.SendKeys] 40 | 41 | Start-Sleep -Seconds $StartDelay 42 | $window = (Get-Process -Name $ProcessName | where {$_.MainWindowHandle -ne ([IntPtr]::Zero)} | select -First 1).MainWindowHandle 43 | Write-Output "Moving $ProcessName to monitor: $MonitorNum" 44 | 45 | $monitor = $MonitorNum-1; 46 | $left = $Screen::AllScreens[$monitor].WorkingArea.Left 47 | $top = $Screen::AllScreens[$monitor].WorkingArea.Top 48 | 49 | $WinAPI::ShowWindow($window, 9) # 9 == Restore 50 | $WinAPI::MoveWindow($window, $left, $top, 1000, 800) 51 | 52 | $WinAPI::SetForegroundWindow($window); 53 | $SendKeys::SendWait("{F11}"); 54 | $SendKeys::Flush(); 55 | 56 | Start-Sleep -Seconds $StartDelay 57 | ## kill full screen browser message - it's w/o title. 58 | $window = (Get-Process -Name $ProcessName | where {$_.MainWindowHandle -ne ([IntPtr]::Zero)} | select -First 1).MainWindowHandle 59 | $stringbuilder = New-Object System.Text.StringBuilder 256 60 | $WinAPI::GetWindowText($window, $stringbuilder, 256) | Out-Null 61 | 62 | if(-Not $stringbuilder.ToString()) { 63 | $WinAPI::SendMessage($window, 0x0010, [IntPtr]::Zero, [IntPtr]::Zero) 64 | Write-Output "Closing F11 window if found" 65 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kiosk Mode In Windows - Chrome or Edge on Multiple Displays 2 | 3 | Moves browser windows in full screen to several displays, creating a sort of Kiosk mode on Windows with Multiple displays. 4 | 5 | It allows you to: 6 | 7 | - start all browser instances in full screen mode automatically 8 | - move them to certain Monitors 9 | - Allow to open multiple tabs (e.g. to cycle through the tabs) 10 | 11 | # Why Not Alternative Solutions? 12 | 13 | ## Alternative 1 - Native CLI 14 | 15 | e.g. from [Stack Overflow Answer](https://stackoverflow.com/questions/29294045/how-to-open-two-instances-of-chrome-kiosk-mode-in-different-displays-windows) 16 | 17 | ``` 18 | start chrome.exe --app="http://www.domain1.com" --window-position=0,0 --kiosk --user-data-dir=c:/monitor1 19 | ``` 20 | 21 | #### Downsides 22 | 23 | * Requires profile folders per monitor 24 | * app mode does not allow tabs 😕 25 | 26 | ## Alternative 2 - Native CLI + Javascript 27 | 28 | e.g. from [Another Stack Overflow Answer](https://stackoverflow.com/questions/13436855/launch-google-chrome-from-the-command-line-with-specific-window-coordinates) 29 | 30 | ``` 31 | "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 32 | --profile-directory="Default" 33 | --app="data:text/html,
" 34 | ``` 35 | 36 | #### Downsides 37 | 38 | * Works only in app mode, which does not allow tabs 😕 39 | 40 | # Steps 41 | 42 | ## 1. Download and Extract 43 | 44 | Download the latest release and extract contents to C:\Kiosk-Mode. 45 | You may put into another folder – but ensure you renamed path in all places. 46 | 47 | ## 2. Modify Kiosk.ps1 48 | 49 | Put necessary URLs and Monitor Numbers (starting from 1) 50 | 51 | ## 3. Enable Scripts Execution 52 | 53 | Run PowerShell as Administrator and execute the following, confirm when prompted: 54 | 55 | ```powershell 56 | Set-ExecutionPolicy RemoteSigned 57 | ``` 58 | 59 | ## 4. Launch Shortcut 60 | 61 | Double click on link (Start – Kios – modifypath.lnk) to ensure browsers are started and opened on necessary displays. 62 | **Note**: you may need to modify your link if you put file not into C:\Kiosk-Mode. Right click on it -> properties and fill it accordingly. 63 | 64 | ## 5. Autostart. 65 | 66 | Copy the link/shortcut to desktop for easy access and to your startup folder. 67 | 68 | ##Troubleshooting 69 | 70 | If window is not moved to another desktop – try increasing the delay in script (add `-StartDelay` parameter to commands). 71 | 72 | Script has been tested on Windows 10 machine. 73 | 74 | # Old Article Link: 75 | 76 | https://alextomin.wordpress.com/2015/04/10/kiosk-mode-in-windows-chrome-on-multiple-displays/ 77 | --------------------------------------------------------------------------------