如何在一个VBScript中运行这两个命令?

时间:2018-03-03 08:02:16

标签: vbscript

如果任务栏处于隐藏模式,则显示并反转。

Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "nircmd.exe win show class Shell_TrayWnd"
Set oShell = Nothing'
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "nircmd.exe win hide class Shell_TrayWnd"
Set oShell = Nothing'

1 个答案:

答案 0 :(得分:0)

您要做的事情称为“切换”,您只需要执行一次操作。来自nircmd documentation

  

togglehide:在可见和隐藏状态之间切换指定的窗口。

Set sh = CreateObject("WScript.Shell")
sh.Run "nircmd.exe win togglehide class Shell_TrayWnd"