Powershell script to start Chrome and more

前端 未结 2 1286
星月不相逢
星月不相逢 2021-01-15 22:06

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 def

2条回答
  •  攒了一身酷
    2021-01-15 22:35

    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
    

提交回复
热议问题