bat文件启动程序后台运行
1、模板
Bat脚本里有隐藏窗口的命令,很简单,只需要在代码头部加一段代码就可以了。
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
::以下添加自己的命令:
示例:
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
set PATH=%cd%\Bin_x64;
echo %PATH%
demo.exe
echo "Demo.exe is starting"
2、VS关闭程序控制台
1. 修改链接器--属性--系统,如下图:
2. 修改链接器--高级--入口点