Windows script to achieve "if a program is running, do nothing, if it is not running, start it"?

assume that the target program is abc.exe and runs with the parameter -a xxx-b xxx , so how do you implement this script?
power shell and normal cmd are both fine.

Mar.26,2021

I don't think you need to write a single line of code, but use the service management that comes with windows to implement it.

registering your program as a windows service can either boot or hang up and start automatically.


tasklist|find /i "abc.exe"
if %errorlevel% == 1 (start abc.exe "-a xxx -b xxx")
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35033-4d5fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35033-4d5fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?