A batch file (test.bat) example is:
@echo off tasklist /v /fi "STATUS eq running" | find "RStudio" echo Complete pause
I