お世話になっております。
掲題のタイトルの通り、VBSまたはPowerShellからedgeを2つ起動させて、上下に並べるスクリプトの
記載方法を探しております。下記内容をedgeでしたいです。
vbs
Option Explicit On Error Resume Next Dim strUrl ' 表示するページ Dim strUrl2 ' 表示するページ Dim objIE ' IE オブジェクト Dim objIE2 ' IE オブジェクト strUrl = "https://www.google.com/" strUrl2 = "https://www.google.com/" Set objIE = WScript.CreateObject("InternetExplorer.Application") Set objIE2 = WScript.CreateObject("InternetExplorer.Application") If Err.Number = 0 Then objIE.Navigate strUrl objIE2.Navigate strUrl2 objIE.Visible = True objIE2.Visible = True objIE.Width = 1390 objIE2.Width = 1390 objIE.Height = 400 objIE2.Height = 400 objIE.Top = 0 objIE2.Top = 380 objIE.Left = 0 objIE2.Left = 0 Else End If Set objIE = Nothing Set objIE2 = Nothing
powershellでは以下のコードがありますが、自動起動と複数起動・それぞれの位置指定を合わせたいです。。(下記はアクティブになっているedgeにしか機能しません)
powershell
$name = "msedge" $w = 100 $h = 700 $x = 0 $y = 0 Add-Type @" using System; using System.Runtime.InteropServices; public class Win32Api { [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); } "@ Get-Process -Name $name | where { $_.MainWindowTitle -ne "" } | foreach { [Win32Api]::MoveWindow($_.MainWindowHandle, $x, $y, $w, $h, $true) | Out-Null }
また位置指定も必要と思うのですが、ご存じの方おられましたら、ご教示いただきたいです。
イメージは以下となります。
(業務で使用するサーバなので、Windows標準機能で行いたいです。)
まだ回答がついていません
会員登録して回答してみよう