你试试这个,写一个VBS,把msg * test替换成你要的命令。另外隐藏运行的批处理只能在任务管理器里面结束CMD.EXE才能结束。
dim fso,testfile
set fso = createobject("scripting.filesystemobject")
set testfile = fso.createtextfile(".\test.bat",true)
testfile.writeline(":s")
testfile.writeline("msg * test")
testfile.writeline("timeout 5")
testfile.writeline("goto s")
testfile.close
createobject("wscript.shell").run ".\test.bat",0
先做一个你想要执行的BATCH文件,再做一个VBS然后用VBS调用BATCH可以隐藏执行
VBS代码如下
Dim wshshell
DO
Set Wshshell = CreateObject("Wscript.Shell")
Wshshell.run "cmd /c D:\test.bat",0,true
Set Wshshell = Nothing
Wscript.Sleep 5000
loop
@echo off
start d:\a.exe 打开d:\a.exe
ping -n 10 127.0>nul 延时10N
start e:\b.exe 打开e:\b.exe
ping -n 100 127.0>nul 延时100N
taskkill /f /im "b.exe" 关闭b.exe
shutdown -s -t 100
ping -n 5 127.1>nul
shutdown -a
ping -n 5 127.1>nul
echo 猪
pause
@echo off
:hello
msg * "hello"
ping /n 5 127.1 >nul
goto hello