运行 casperjs with cmd multi-window

Running casperjs with cmd multi-window

我阅读了一些有关此主题的问题,但找不到解决方案。

这是我简化的批处理文件:

:MENU
CLS
ECHO.
ECHO ...............................................
ECHO Mes y a¤o elegidos: %D%/%Y%
ECHO Listado de locales 
ECHO Seleccione local para generar informe mensual
ECHO ...............................................
ECHO.
ECHO [1][COD-3003] CORNER LIDER LOS ANDES           
ECHO [2][COD-1003] CORNER MALL QUILPUE 2° PISO      
ECHO [3] 2 and 3            

SET /P M=Digita el numero del local o codigo, digita 0 para incluir todos: 
ECHO.
IF %M%==1 GOTO LOCAL1
IF %M%==2 GOTO LOCAL2
IF %M%==3 GOTO ALL

:LOCAL2
CLS
start /D "C:\n1k0-casperjs-4f105a9\sigo" cmd /k "casperjs test_optimizando_velocidad3.js 157 %D% %Y%"
GOTO MENU

:ALL
CLS
start /D "C:\n1k0-casperjs-4f105a9\sigo" cmd /k "casperjs test_optimizando_velocidad3.js 123 %D% %Y%"
CLS
start /D "C:\n1k0-casperjs-4f105a9\sigo" cmd /k "casperjs test_optimizando_velocidad3.js 157 %D% %Y%"

(忘记路线,我只是复制并粘贴了原始文件的一部分)

这种方法可以满足我的需要。每次我 select 一个选项都会用脚本 运行 打开一个新的 window 但是当它完成时不会关闭,所以当我选择所有(我有 20 个选项)时打开 20 windows 然后当脚本完成时在每个脚本上显示提示而不是关闭。

我尝试使用 casperjs 退出选项,但它没有用,所有其他问题都与在同一 window 中打开脚本有关,我真的不知道如何在使用新的时管理它 windows.

谢谢,对不起我的英语,它不是我的母语

start 命令中使用 cmd /c 而不是 cmd /k

来自cmd /?

/C      Carries out the command specified by string and then terminates
/K      Carries out the command specified by string but remains

window 保持打开状态,因为 cmd 进程在命令完成后未退出。