Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell script to start Chrome and more

I need a script that will start Google Chrome and then send a signal for it to go into full screen mode (usually done by hitting f11).

Chrome is installed to the default location.

An example of what I have tried is:

Start-Process -FilePath "C:\Program Files(x86)\Google\Chrome\Application\chrome"

This simple string is not even working for me.

like image 668
BA64 Avatar asked Dec 06 '25 17:12

BA64


1 Answers

Sometimes a temporary folder is needed to get Chrome to start this way, so in those cases this might work.

$pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
$tempFolder = '--user-data-dir=c:\temp' # pick a temp folder for user data
$startmode = '--start-fullscreen' # '--kiosk' is another option
$startPage = 'https://stackoverflow.com'

Start-Process -FilePath $pathToChrome -ArgumentList $tempFolder, $startmode, $startPage
like image 85
HanShotFirst Avatar answered Dec 09 '25 19:12

HanShotFirst