我只是想撰寫一些可以將 Chrome 瀏覽器啟動到“關于”頁面的代碼;或者打開一個帶有“關于”頁面的選項卡,它將在 PowerShell 中運行。
我嘗試了以下方法,它只會導致 chrome 打開一小段時間,然后關閉......
`
Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList '"chrome://about"'
`
這適用于任何 HTTP/S: 位置,但我認為它不喜歡“Chrome:”標簽。
... 有任何想法嗎?
uj5u.com熱心網友回復:
這是因為該著陸頁/標簽不是合法的 URL。所以你可以這樣做(雖然好吧,你知道的,SendKeys ...)。
Add-Type -AssemblyName System.Windows.Forms
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe'
Start-Sleep -Milliseconds 300
[System.Windows.Forms.SendKeys]::SendWait('chrome://about{Enter}')
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/537420.html
