Here is a possible solution:
From your first script, call your second script with the following line:
wscript.exe invis.vbs run.bat %*
Actually, you are calling a vbs script with:
- the [path]
ame of your script
- all the other arguments needed by your script (
%*
)
Then, invis.vbs will call your script with the Windows Script Host Run() method, which takes:
- intWindowStyle : 0 means "invisible windows"
- bWaitOnReturn : false means your first script does not need to wait for your second script to finish
Here is invis.vbs:
set args = WScript.Arguments
num = args.Count
if num = 0 then
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
WScript.Quit 1
end if
sargs = ""
if num > 1 then
sargs = " "
for k = 1 to num - 1
anArg = args.Item(k)
sargs = sargs & anArg & " "
next
end if
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…