vbscript - 如何在 vbscript 中静默运行 exe
问题描述
我制作了一个执行 EXE 的脚本,它改变了我笔记本电脑的风扇速度。但是在启动时我得到恼人的控制台弹出窗口,我该如何让它消失?
脚本:
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "DellFanCmd", "ec-disable-nofanchg", "", "runas", 1
objShell.ShellExecute "DellFanCmd", "fan1-level1", "", "runas", 1
谢谢
解决方案
句法
.ShellExecute "application", "parameters", "dir", "verb", window
.ShellExecute 'some program.exe', '"some parameters with spaces"', , "runas", 1
钥匙
application The file to execute (required)
parameters Arguments for the executable
dir Working directory
verb The operation to execute (runas/open/edit/print)
window View mode application window (normal=1, hide=0, 2=Min, 3=max, 4=restore, 5=current, 7=min/inactive, 10=default)
1
所以你的代码可以写成如下0
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "DellFanCmd", "ec-disable-nofanchg", "", "runas", 0
objShell.ShellExecute "DellFanCmd", "fan1-level1", "", "runas", 0
推荐阅读
- javascript - PWA 的多个清单
- visual-studio - Xamarin.Android: 包 XX 与 monoandroid81 不兼容 (MonoAndroid,Version=v8.1)
- kotlin - Getting RuntimeException for kotlin code
- c# - C#文件夹浏览对话框不显示网络共享文件夹win10
- linux - bluetooth connection fail with bluetoothctl command
- .net - 如何使用 cake build 自动化控制台应用程序 exe
- linux - X11 注销信号
- python - 创建一组涉及浮点数的实例
- prolog - Swi-prolog 类型错误:预期为“列表”,找到一个化合物
- spring-boot - 带有嵌入式 tomcat 的 Spring Boot 在临时文件夹中创建空目录