Windows隐藏cmd运行窗口
目录
注意
本文最后更新于 2021-10-29,文中内容可能已过时。
使用开源软件实现(推荐)
hidecon.exe 官网地址
使用方法,将hidecon.exe和其他可执行放在一块,在bat脚本前面加上
hidecon.exe
npc -server=xxx:8888 -vkey=xxxxxxxxxxxxxxxx -type=tcp
使用vbs实现(推荐)
CreateObject("WScript.Shell").Run "D:\syncthing\syncthing.exe",0
或者批量运行:
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c start 1.exe",vbhide
ws.run "cmd /c start 2.exe",vbhide
ws.run "cmd /c start 3.exe",vbhide
复制保存成vbs文件即可。
使用cmd实现(会有一闪而过的黑窗)
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
::以下为正常批处理命令,不可含有pause set/p等交互命令
复制保存为bat文件即可。