![]() tasklist /FI "IMAGENAME eq notepad.exe" /FO CSV > search.log FINDSTR notepad.exe search.log > found.log FOR /F %%A IN (found.log) DO IF %%~zA EQU 0 GOTO end start notepad.exe :end del search.log del found.log ![]() The trick is to make sure your running batch process maintains an exclusive write lock on I don't have a heap of batch scripting experience, so my soulution is to then search for the process name in the search.log file and pump the results into another file and search that for any output. How to check if a batch file is running on Windows?, I believe a lock file is the simplest reliable solution. Check if PowerShell script is running using batch script Check if batch file is running
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |