Terminate with taskkill one specific RealtimeSync task via batch

Get help for specific problems
Vikiller94
Posts: 1
Joined: 11 Sep 2019

Post by Vikiller94 • 11 Sep 2019, 09:59

Hello,

I want that one RealTimeSync task opens automatically when a certain program starts and of course close when the certain program closes.

I have two different tasks from Realtimesync (two red loops in my taskbar). One shall be executed from the startup (not important) but the other one shall follow the operation I described above.

The problem appears with the command "taskkill".

I cannot define the RealTimeSync task because they have both equal names (RealTimeSync_x64.exe) and the PID changes every time.
Because I do not want to execute the batch file manually but automatically, the PID method is unusable.

Is there a method to define the specific RealTimeSync task? If yes how I can include in the "taskkill" operation?

User avatar
Plerry
Posts: 707
Joined: 22 Aug 2012

Post by Plerry • 11 Sep 2019, 14:48

I am not sure your use-case makes much sense.
RealTimeSync (RTS) will only launch the specified application (most commonly: FreeFileSync, FFS), upon detecting a change in the monitored folder(s), followed by some inactivity, its the idle time setting.
If your "certain program" ends by writing one or more files, and consequently the RTS task is killed, the RTS idle time likely has not passed yet, so RTS will not launch an FFS sync.

It seems better to simply always launch and FFS sync after the "certain program" has ended.
This will assure any changes that occurred during execution of the "certain program" will be synced.