[英]How to launch chrome browser fullscreen in windows with new window and in specific monitor
[英]Launch Chrome with specific profile in PowerShell
我試圖在 PowerShell 中使用特定的用戶配置文件(--profile-directory 參數)啟動 Chrome,但它創建了一個新的配置文件。
我試過了:
& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Foobar
& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory=Foobar"
& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory='Foobar'"
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Foobar
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory=Foobar"
ETC....
也許你的路徑名中有空格。 嘗試這個:
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" '--profile-directory="Foo Bar"'
或這個:
& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" '--profile-directory="Foo Bar"'
更新:請注意,您不能只使用任何路徑,而是使用簡單的名稱,如“Foo”或“Foo Bar”,表示c:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data
的子目錄,例如c:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Foo Bar
。 根據您的操作系統和操作系統版本,目錄名稱可能會略有不同。 如果它們在Win7和Win10上相同,我不知道。 我現在的機器是Win10 PC。
我仍然無法獲得 powershell Start-Process 命令以啟動具有多個標志的 chrome,這可能是因為瀏覽器版本在 2 年后不同。 對我來說,使用 Windows 10 版本 1902,Chrome 版本 76.0.3809.132(官方構建)(64 位)
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-web-security, --disable-gpu, --user-data-dir=~/chromeTemp
添加逗號並使用“chromeTemp”而不是“/path/to/User Data”是對我有用的更改。
嘗試在命令下運行。 這將幫助您從命令行以不同的用戶身份啟動 chrome,而無需通過 GUI 提示。 最好創建一個 .bat 文件並保存您的憑據。
runas /user:John C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe"
這適用於來自 powershell 的新配置文件
start-process Chrome "http://localhost:9876/debug.html",'--profile-directory="Profile 4"'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.