Powershell script to start Chrome and more

18,186

Solution 1

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

Solution 2

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'

Share:
18,186
BA64
Author by

BA64

Updated on July 17, 2022

Comments

  • BA64
    BA64 almost 2 years

    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.

  • BA64
    BA64 almost 7 years
    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!
  • halfer
    halfer almost 7 years
    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.
  • user3772108
    user3772108 over 3 years
    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.