I'm trying to set up an automated backup of my Thunderbird database using my chosen backup program Beyond Compare. With that in mind, I've created a small batch file tha… (read more)
I'm trying to set up an automated backup of my Thunderbird database using my chosen backup program Beyond Compare. With that in mind, I've created a small batch file that shuts down Thunderbird, runs the backup application to create the snapshot, and then starts up Thunderbird again.
If I just run this batch job from a command prompt, it works perfectly. The batch shuts down TB, I get my backup data copy, and then the batch restarts TB.
I can run this batch job multiple times and it succeeds every time and works perfectly.
Now I just invoke the batch job from Windows 10's Task Scheduler and things go south. The TB shutdown and backup go fine, and the batch job starts up TB. TB appears in the task scheduler window, but I never get the window, and I have to open Task Manager and kill the copy of TB and manually start it to get the desktop window back.
Can anyone tell me what is happening and how to make this automation work?
Contents of the batch file in question
for /l %%x in (1, 1, 10) do (
rem echo Loop iteration count %%x
taskkill /im thunderbird.exe
taskkill /f /im thunderbird.exe
start "" "C:\Program Files\Beyond Compare 4\BCompare.exe" "@D:\BC_Sync\Thunderbird Snapshot to H.txt" /wait
start "" "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"