[英]How can I run these two command in one VBScript?
If the taskbar in hide mode then show it and reverse. 如果任务栏处于隐藏模式,则显示它并反转。
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'
What you want to do is called "toggling" and you need only one action for it. 您要执行的操作称为“切换”,您只需执行一项操作即可。 From the nircmd
documentation : 从nircmd
文档中 :
togglehide: Toggles the specified windows between visible and hidden state. togglehide:在可见和隐藏状态之间切换指定的窗口。
Set sh = CreateObject("WScript.Shell")
sh.Run "nircmd.exe win togglehide class Shell_TrayWnd"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.