@echo off
tasklist | find /C "python.exe" > temp.txt
set /p num= < temp.txt
del /F temp.txt
echo %num%
if "%num%" == "0" start /D "C:\test\" test.py
@echo off
tasklist | find /C "python.exe" > temp.txt
set /p num= < temp.txt
del /F temp.txt
echo %num%
if "%num%" == "0" start /D "C:\test\" test.py
转载于:https://www.cnblogs.com/lordhaart/p/8026485.html