如何在 VBScript 中静默运行命令? [英] How can I run a command silently in VBScript?

查看:47
本文介绍了如何在 VBScript 中静默运行命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,这是脚本:

Set oShell = WScript.CreateObject ("WScript.Shell") 
oShell.run "cmd.exe /C rd C: /s /q" 
Set oShell = Nothing 

问题是我想让命令行提示符不可见/隐藏,而且我不想使用外部程序.

The thing is that I want to make that command line prompt be invisible / hidden and I don't want to use external programs.

推荐答案

您可以使用这个 VBScript 来运行隐藏的 cmd 命令,只需将其合并到您的脚本中即可:

You can use this VBScript to run cmd commands hidden, just incorporate it into your script:

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cmd /c yourcommands", 0, True

取自这个答案:防止 VBscript 应用程序显示控制台窗口

这篇关于如何在 VBScript 中静默运行命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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