批处理文件打开 4 或 6 个 Internet Explorer 屏幕,并通过均等划分桌面来放置它们

批处理文件打开 4 或 6 个 Internet Explorer 屏幕,并通过均等划分桌面来放置它们

我打算编写一个脚本,可以打开4-6个IE屏幕,并可自动放置在桌面上。

因此,基本上所有 IE 屏幕在桌面上都会获得相同的空间。我知道打开 4 个或更多 IE 屏幕的命令,但是我无法使用脚本将它们放在桌面的不同部分。下面是我用来打开 IE 屏幕的脚本示例。

@echo off

start /d "" IEXPLORE.EXE 172.21.83.51
start /d "" IEXPLORE.EXE 172.21.83.52

任何帮助将不胜感激。

答案1

Batch 无法做到这一点。但 PowerShell 可以

这是一个非常简单的示例,打开两个 Internet Explorer 窗口并移动/调整它们的大小

$ie1 = new-object -comobject InternetExplorer.Application
$ie1.navigate("http://google.com")
$ie1.visible = $true    
$ie1.top = 10
$ie1.width = 790
$ie1.height = 790 
$ie1.Left = 10
  
$ie2 = new-object -comobject InternetExplorer.Application
$ie2.navigate("http://bing.com")
$ie2.visible = $true    
$ie2.top = 10
$ie2.width = 790
$ie2.height = 790 
$ie2.Left = $ie1.Left + $ie2.width

相关内容