3

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
BA64
  • 51
  • 1
  • 1
  • 3
  • so what have you tried, what doesn't work? – 4c74356b41 Jun 02 '17 at 18:12
  • well im not by any means an actual powershell scriptor. ive tried looking up other scripts that should start the application but none seem to work for me. – BA64 Jun 02 '17 at 18:27

2 Answers2

10

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
HanShotFirst
  • 156
  • 1
  • 6
  • This solution solved my problem with starting chrome as a different user (Parameter -Credential). The error message `Could not find file` was caused because of the missing temp folder argument. Thanks a lot. – user3772108 Nov 16 '20 at 13:10
1

These types of questions are frowned upon due to you not stating what you have tried and you are just asking for a solution. However since this is simple I couldn't resist. Start-Process {Your full path to chrome.exe}\chrome.exe -ArgumentList '--start-maximized'

Randy Rakestraw
  • 331
  • 1
  • 10
  • 1
    Ok, im sorry, I just created my account to ask this question and did not know this. This is basically what I have already tried but I did not know I had to add the '-ArguementList' part Thanks for the help! – BA64 Jun 02 '17 at 18:39
  • 2
    You're right that we like research and prior effort here, but we generally discourage meta-commentary from answers too. Keep answers focussed on answer material, and put advice in comments under the answer. – halfer Jun 02 '17 at 22:56