Start anki.exe from .bat file

I have a file, startup.bat that, among other things, launches a few apps, including Anki. I have two problems.

  1. I want the bat file to start Anki and not wait for it to terminate. The only command I have found that will do this is:

start /min cmd /c start C:\Progra~1\Anki\Anki.exe

which is ridiculously complicated compared with any other app. Other combinations of start, cmd and call do not return control to the bat file until Anki terminates.

  1. Anki sometimes becomes invisible. The process is still there in Task Manager but there is no window. If I try to relaunch it, the new instance detects the old instance and terminates, leaving just the old, invisible process. I have to

taskkill /im anki.exe /f

in my bat file to kill off any invisible process before launching it.

These problems aren’t specific to running from a bat file, they also happen in an interactive Command Prompt window. Launching Anki from the GUI by double-click works as expected.

I’m posting this in the hope that someone can explain what’s going on and in case it helps anyone else.

Window 10
Version ⁨24.06.3 (d678e393)⁩
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1

Here I use it this way and it works

start /b D:\Anki\Anki.24.06\anki.exe -b D:\Anki\Anki.2.1.data

2 Likes
  1. Definitely try the documented syntax for this start /b [exe] -b [datapath]Managing Files - Anki Manual – the same as @cjdduarte uses.

  2. What version are you using? There was a known bug recently that impacted a few users where Anki would hang on closing and have to be killed before running again. Or if it is not appearing on opening, see the FAQ Startup Issues - Anki Manual .

Thanks for the suggestion guys. It works from an interactive Command Prompt - control returns to the console as soon as Anki is launched - but not from my .bat file - control doesn’t return until Anki exits.

I don’t know what to suggest beyond that. The simple “start” syntax from the manual works for me in a bat file, and the cmd window barely flashes on the screen before disappearing. Maybe if you post what is displayed at the command prompt that appears and sticks around, someone will have other ideas?

Adding:
Are you running the bat file by clicking on it in File Explorer, or in text from a command line?