I created a batch file to demonstrate some components for your solution:
Note: Credit to this answer for the PID extraction, pointed out by @JacobIRR.
TITLE Synology-Script
@echo off
for /F "tokens=2" %%K in ('
tasklist /FI "WINDOWTITLE eq Synology-Script" /FI "Status eq Running" /FO LIST ^| findstr /B "PID:"
') do (
set pid=%%K
echo %%K
)
echo "I'm scheduled to stop execution in 10 seconds"
timeout /t 10 /nobreak>nul
taskkill /PID %pid% /F
I used the TITLE paremeter to give me something to search for, and searched for that in the tasklist filter command on offer from this question. I recommend not including spaces in your title. I used this pid as an argument to taskkill, which terminates this process.
timeout /t 10 /nobreak>nul
This lets us sleep for 5 seconds, and stuffs the 'press ctrl+c' to nul, to keep it out of sight. You could set the 5 to whatever your desired sleep interval is.