并排启动两个资源管理器窗口 [英] Launch two Explorer windows side-by-side

查看:136
本文介绍了并排启动两个资源管理器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过批处理脚本并排启动两个资源管理器窗口(垂直平铺)?

Is there a way to launch two Explorer windows side-by-side (vertically tiled) with a Batch script?

如果没有,我该如何使用VBS?

If not, how might I do this with VBS?

推荐答案

我已经通过 Hackoo 修改了上面的VBS脚本,以完全执行OP想要的操作...

I have modified the VBS script above by Hackoo to do exactly what the OP wants...

脚本中的注释完全解释了它将执行的操作.
如果两个窗口的位置都不正确,请增加睡眠"时间,然后重试.
如果要水平分割,请使用'objShell.TileHorizo​​ntally'.

The comments in the script explain exactly what it will do.
If the two windows don't set into correct position, increase the 'Sleep' time and try again.
If you want a horizontal split, use '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
'*****************************************************

这篇关于并排启动两个资源管理器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆