bat文件運行時隱藏黑色的cmd窗口,需要讓bat在後臺運行。
在bat文件中頭部加一段代碼
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
自己的邏輯代碼
bat文件運行時隱藏黑色的cmd窗口,需要讓bat在後臺運行。
在bat文件中頭部加一段代碼
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
自己的邏輯代碼
shell腳本獲取腳本所在目錄 執行腳本的父目錄不一定是當前的工作目錄。 url=$(dirname $(readlink -f $0))