静默执行bat文件

让bat隐藏运行需要用vbs文件才能实现,

方式一(使用vbs文件):

新建一个 文本文档后缀改为“vbs” ,
可以这样写↓

set ws=WScript.CreateObject("WScript.Shell")
ws.Run "d:\yy.bat",0

↑其中d:\yy.bat是你需要运行的 bat文件 的路径。

也可以这样写↓

Set shell = Wscript.createobject("wscript.shell")
a = shell.run ("send_sl_scroll.bat",0)

↑"send_sl_scroll":需要执行的bat文件名

方法二:用 文本文档 打开 bat文件

在bat文件开头处写入

@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
REM

这个方法运行bat,还是闪了一下。

参考地址:https://www.baidu.com/

posted @ 2022-06-22 18:05  哒哒哒~~~  阅读(1500)  评论(0编辑  收藏  举报