Powershell脚本启动Chrome等 [英] Powershell script to start Chrome and more

查看:843
本文介绍了Powershell脚本启动Chrome等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个脚本,该脚本将启动Google Chrome,然后发送信号使其进入全屏模式(通常是按f11键).

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已安装到默认位置.

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.

推荐答案

有时需要一个临时文件夹来使Chrome以这种方式启动,因此在这种情况下,这可能行得通.

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

这篇关于Powershell脚本启动Chrome等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆