我有一个 PowerShell 脚本,可以在 Internet Explorer 中打开某个链接。到目前为止我有以下代码。它会打开链接,但当我特别需要在 Internet Explorer 中打开它时,它会发送到我的默认浏览器。
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut($env:USERPROFILE + "\Desktop\TMW.lnk")
$ShortCut.TargetPath="http://tmw1.casttrans.com/rdweb"
$ShortCut.WorkingDirectory = "C:\Program Files (x86)\Internet Explorer";
$ShortCut.WindowStyle = 1;
$ShortCut.IconLocation = "iexplore.exe, 0";
$ShortCut.Save()
Run Code Online (Sandbox Code Playgroud)