[Windows] How to install Anki in Program Files and set ANKI_BASE to user folders

Hello,

My computer policies block installing applications in user’s folders.

Therefore, I’m trying to install Anki in Program Files and set Anki Base to user’s editable folders.

I tried with *.bat file similar to installing on USB:

@echo off
set ANKI_LAUNCHER_VENV_ROOT="C:\Program Files\Anki\AnkiProgramFiles"
set ANKI_LAUNCHER="C:\Program Files\Anki\Launcher\anki"
set ANKI_BASE=C:\Users\username\AppData\Local\Anki
echo Starting installing Anki...
start /b %ANKI_LAUNCHER%
echo Installed Anki...

It sets the variables but doesn’t run the launcher.

Do you have any ideas how to make it work?

Assuming that the C:\Program Files\Anki\Launcher\anki executable does exist, perhaps try changing the start line to:

start "" /b %ANKI_LAUNCHER%

I don’t use Windows, but a brief internet search seems to suggest that when using an executable path surrounded by quotation marks, the title parameter needs to be provided. (So, we provide a quoted empty string as the title parameter.)

1 Like

Sorry, but it didn’t help.

I even tried to put the direct path to the launcher with no success.

When you execute the start "" /b "C:\Program Files\Anki\Launcher\anki" command manually from Command Prompt, what error messages do you see?

And, if running it from the Command prompt doesn’t work:

  • Have you verified whether the C:\Program Files\Anki\Launcher\anki file exists at that location when you look for it in File Explorer?
  • If you try to execute it in File Explorer, does it run then?
1 Like

Finally, it started to work with the following commands (double quote and double backslash made the difference):

@echo off
echo Starting Anki...
set USB_ROOT=%~dp0
set ANKI_LAUNCHER_VENV_ROOT=%USB_ROOT%\AnkiProgramFiles
set ANKI_LAUNCHER=%USB_ROOT%\Launcher\anki
set ANKI_BASE=C:\Users\username\AppData\Local\Anki
start "" /b "C:\Program Files\Anki\\Launcher\anki"

The Anki.bat file is located in C:\Program Files\Anki

Thanks for help.

2 Likes