隐藏CMD窗口使程序在后台执行
隐藏CMD窗口使程序在后台执行代码如下:
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
要执行的代码放在此处即可
##例如我要将jupyter后台运行并设置开机启动可以这样操作,如图:
将bat脚本复制到C:\Users\admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 目录下,以后开机都会自动后台启动了
win+R调出运行输入 shell:startup
回车即可打开启动文件夹