@echo offSETLOCAL ENABLEDELAYEDEXPANSION REM 延迟环境变量扩展color Eecho operate:1.start启动 2.stop停止 3.exit退出:loopset /p a=please enter operate: for %%i in (MessagePush.ClientHost.exeMessagePush.PushHost.exe) do ( set j=%%i set k=!j:~0,-4! if %a%==3 ( exit ) else ( if %a%==2 ( tasklist|find /i "!k!"&& taskkill /t /im !j!|| echo %time:~,-3% !j! already killed! echo !j! has killed ) else ( if %a%==1 ( tasklist|find /i "!k!"&& echo %time:~,-3% !j! already started!|| start "" "D:\work\PushTrans2.0\!k!\bin\Release\!j!" echo !j! has started ) else ( echo caution:please enter right operate goto loop ) ) ))pause>nulrem 不显示“请按任意键继续. . .”