答案1
当这样调用时,脚本基本上会等待那些应用程序完成/关闭,然后继续执行脚本。
您需要使用start
命令调用它们,该命令将调用每个应用程序,然后将控制权返回给脚本以便它可以继续,然后根据调用方式,返回到 cmd 提示符(如果从打开的 cmd 提示符运行),或关闭窗口(如果 .bat 从 Windows 运行)。
@echo off
start microsoftedge.exe
start "C:\Program
Files\WindowsApps\5319275A.WhatsAppDesktop_2.2332.9.0_x64__cv1g1gvanyjgm\WhatsApp.exe"
:end
@exit /b
答案2
@echo off
start "" /b "%LocalAppData%\Microsoft\WindowsApps\MicrosoftEdge.exe"
start "" /b "%ProgramFiles%\WindowsApps\5319275A.WhatsAppDesktop_2.2332.9.0_x64__cv1g1gvanyjgm\WhatsApp.exe"
使用:Start "" /B
Syntax
START "title" [/D path] [options] "command" [parameters]
Key:
title Text for the CMD window title bar (required.)
path Starting directory.
command The command, batch file or executable program to run.
parameters The parameters passed to the command.
B Start application without creating a new window.