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 my batch file.
@Echo off
for /l %%x in (1, 1, 10) do (
rem echo Loop iteration count %%x
taskkill /im thunderbird.exe
)
taskkill /f /im thunderbird.exe
timeout 10
start "" "C:\Program Files\Beyond Compare 4\BCompare.exe" "@D:\BC_Sync\Thunderbird Snapshot to H.txt" /wait
timeout 10
start "" "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"
TB Appears in my task list, just doesn't actually product the desktop window!
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 my batch file.
@Echo off
for /l %%x in (1, 1, 10) do (
rem echo Loop iteration count %%x
taskkill /im thunderbird.exe
)
taskkill /f /im thunderbird.exe
timeout 10
start "" "C:\Program Files\Beyond Compare 4\BCompare.exe" "@D:\BC_Sync\Thunderbird Snapshot to H.txt" /wait
timeout 10
start "" "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"
TB Appears in my task list, just doesn't actually product the desktop window!