并排启动两个资源管理器 windows
Launch two Explorer windows side-by-side
有没有办法使用批处理脚本并排(垂直平铺)启动两个资源管理器 windows?
如果没有,我该如何使用 VBS 执行此操作?
这可能与您的问题属于同一类别。 :)
How can a batch file run a program and set the position and size of the window?
不幸的是,如果没有任何外部第三方软件批量处理似乎是不可能的。在 VBS 中可能更容易 - 如果是这样,答案应该在 link 中。
试试这个代码:
Option Explicit
Dim Calc,AppData
Calc = "%windir%\system32\calc.exe"
AppData = "%AppData%"
Call Explore(Calc)
Call Explore(AppData)
'*****************************************************
Function Explore(Path)
Dim ws
set ws = CreateObject("wscript.shell")
Explore = ws.run("Explorer /n,/select,"& Path &"")
End Function
'*****************************************************
我已经通过 Hackoo 修改了上面的 VBS 脚本,以完全按照 OP 的要求...
脚本中的注释准确解释了它将做什么。
如果两个windows没有设置到正确的位置,增加'Sleep'时间再试。
如果要水平拆分,请使用 'objShell.TileHorizontally'.
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Launches two Explorer windows side-by-side filling the screen dimensions.
''' Minimizes all current open windows before launch; if this is not done,
''' the current open windows will also be resized along with our two windows.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Calc,AppData,objShell
Calc = "%windir%\system32\calc.exe"
AppData = "%AppData%"
Set objShell = CreateObject("shell.application")
objShell.MinimizeAll
Call Explore(Calc)
WScript.Sleep 800
Call Explore(AppData)
WScript.Sleep 800
objShell.TileVertically
Set objShell = nothing
'*****************************************************
Function Explore(Path)
Dim ws
set ws = CreateObject("wscript.shell")
Explore = ws.run("Explorer /n,/select,"& Path &"")
End Function
'*****************************************************
有没有办法使用批处理脚本并排(垂直平铺)启动两个资源管理器 windows?
如果没有,我该如何使用 VBS 执行此操作?
这可能与您的问题属于同一类别。 :) How can a batch file run a program and set the position and size of the window?
不幸的是,如果没有任何外部第三方软件批量处理似乎是不可能的。在 VBS 中可能更容易 - 如果是这样,答案应该在 link 中。
试试这个代码:
Option Explicit
Dim Calc,AppData
Calc = "%windir%\system32\calc.exe"
AppData = "%AppData%"
Call Explore(Calc)
Call Explore(AppData)
'*****************************************************
Function Explore(Path)
Dim ws
set ws = CreateObject("wscript.shell")
Explore = ws.run("Explorer /n,/select,"& Path &"")
End Function
'*****************************************************
我已经通过 Hackoo 修改了上面的 VBS 脚本,以完全按照 OP 的要求...
脚本中的注释准确解释了它将做什么。
如果两个windows没有设置到正确的位置,增加'Sleep'时间再试。
如果要水平拆分,请使用 'objShell.TileHorizontally'.
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Launches two Explorer windows side-by-side filling the screen dimensions.
''' Minimizes all current open windows before launch; if this is not done,
''' the current open windows will also be resized along with our two windows.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Calc,AppData,objShell
Calc = "%windir%\system32\calc.exe"
AppData = "%AppData%"
Set objShell = CreateObject("shell.application")
objShell.MinimizeAll
Call Explore(Calc)
WScript.Sleep 800
Call Explore(AppData)
WScript.Sleep 800
objShell.TileVertically
Set objShell = nothing
'*****************************************************
Function Explore(Path)
Dim ws
set ws = CreateObject("wscript.shell")
Explore = ws.run("Explorer /n,/select,"& Path &"")
End Function
'*****************************************************