I am calling a program using batch file which Pops-up a cmd window. I need to refresh it every 30 seconds and I can do it manually by writing R in the cmd. I want to automate it now.
Solution I expect:
- look for this program in tasklist every 30 seconds (done)
- invoke/access it from tasklist and write R (do not know how to implement)
Code (file: run_myapp.bat):
set appName=MyApp.exe
call C:\Scripts\%appName% "0" "Blue"
wait 2000
::
:ReFresh
tasklist /FI "IMAGENAME eq appName" 2>NUL | find /I /N "appName">NUL
if "%ERRORLEVEL%"=="0" (
...
**rem I need some code here to access/invoke the app from tasklist and write R in it**
...
echo Last refreshed at %time%
wait 30000
goto :ReFresh
)