cmd静默运行_以静默方式运行一个cmd或BAT

How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user.解决方案That should answer your question.Here it is:From your first script, call your...
摘要由CSDN通过智能技术生成

How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user.

解决方案

That should answer your question.

Here it is:

From your first script, call your second script with the following line:

wscript.exe invis.vbs run.bat %*

Actually, you are calling a vbs script with:

the [path]\name of your script

all the other arguments needed by your script (%*)

Then, invis.vbs will call your script with the Windows Script Host Run() method, which takes:

intWindowStyle : 0 means "invisible windows"

bWaitOnReturn : false means your first script does not need to wait for your second script to finish

See the question for the full invis.vbs script:

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run ""&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以使用SilentCMD来实现cmd静默运行。SilentCMD一个功能强大的命令行工具,可以让您在后台运行控制台应用程序和批处理文件,而无需显示任何窗口。您只需要在命令提示符中输入SilentCMD,后面跟上您要运行的.bat文件的路径和参数,就可以在后台静默地完成工作了。您还可以选择将输出和错误记录到文本文件中。这样,您就可以在不打扰用户的情况下运行命令行操作了。\[1\]如果您想要让.bat文件在后台无声无息无影无形地运行,您可以使用SilentCMD提供的功能。它是一个轻量级的命令行实用程序,可以处理UAC特权提升,并且可以并行或同步运行多个命令。您可以通过用户界面来设置SilentCMD,非常方便易用。\[3\]这样,您就可以轻松实现cmd静默运行了。\[2\] #### 引用[.reference_title] - *1* *3* [如何在Win10上静默运行批处理文件](https://blog.csdn.net/weixin_39804335/article/details/111864574)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [exe、msi、dos、bat静默运行,后台运行,不弹窗的解决办法](https://blog.csdn.net/weixin_39553753/article/details/111864583)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值