# Error at startup of Anki portable

**URL:** <https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201>\
**Category:** Help\
**Created:** [October 27, 2025, 11:45am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201 "2025-10-27T11:45:40Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 27, 2025, 11:45am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/1 "2025-10-27T11:45:40Z")

</div>

Hello!  
I installed Anki on a flash drive following [these instructions](https://docs.ankiweb.net/files.html?highlight=portable#running-from-a-flash-drive) and, when I double-click on the .bat file to run Anki, I get the following message.

 ![2025-10-27 133733](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/7/671aa9ca4d80ea23dc1bf158f24b17eafbead08e.jpeg)

Have I done something wrong?  
Thank you!

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [October 29, 2025, 7:20am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/2 "2025-10-29T07:20:30Z")

</div>

This suggests a problem with your ANKI\_BASE variable. Have you adjusted the USB drive letter as suggested? Can you post your Anki.bat?

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 29, 2025, 11:57am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/3 "2025-10-29T11:57:32Z")

</div>

Could you please explain the 2nd step of the instructions to me?

> 1. When the launcher appears, close it **without installing**.

Since in the 1st step says:

> 1. Download the latest Anki launcher, and **install it** in a custom location: `E:\Anki\Launcher`. Not `E:\Anki\Launcher\Anki`.

How can I not install it, when I will already have installed it?

Thanks!

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 29, 2025, 12:17pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/4 "2025-10-29T12:17:52Z")

</div>

The USB drive letter is L: and the text of my Anki.bat is:

```auto
@echo off
echo Starting Anki...
set USB_ROOT=%~dp0
set ANKI_LAUNCHER_VENV_ROOT=L\AnkiProgramFiles
set ANKI_LAUNCHER=L\Launcher\anki
set ANKI_BASE=L\AnkiData
start /b %ANKI_LAUNCHER%

```

In fact, I do not know if and how I must replace `%~dp0` and `%ANKI_LAUNCHER%`…

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [October 29, 2025, 1:03pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/5 "2025-10-29T13:03:29Z")

</div>

> [@SSp](#):
>
> > 1. Download the latest Anki launcher, and **install it** in a custom location:
> > 2. When the launcher appears, close it **without installing**.
> 
> How can I not install it, when I will already have installed it?

I’ve never performed this process. Hopefully someone more familiar with it can help confirm and clarify, but my interpretation is that the instructions are, in more detail:

1. Download the Anki launcher, and move/copy the launcher into a custom location.
2. Run the launcher but immediately close it after the launcher menu appears. That is, do not tell the launcher to install Anki itself (which is one of the menu options). Instead, just close the launcher immediately.

---

<div class="post-metadata">

**Author:** ![remline](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/remline/32/26354_2.png) [@remline](https://forums.ankiweb.net/u/remline)\
**Post date:** [October 29, 2025, 1:41pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/6 "2025-10-29T13:41:43Z")

</div>

> [@SSp](#):
>
> `set ANKI_BASE=L\AnkiData`

I don’t know much about Anki portable, but I notice that the colon (“:”) character is missing in your variable.

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 30, 2025, 10:38am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/7 "2025-10-30T10:38:40Z")

</div>

So, do I have to replace `%USB_ROOT%` with `L:\Anki`?  
What about the other two variables: `%~dp0` and `%ANKI_LAUNCHER%`?

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [October 30, 2025, 12:37pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/8 "2025-10-30T12:37:54Z")

</div>

You posted a link to a Anki Manual page with instructions. As I understand it, if someone follows the instructions exactly, they don’t need to make any changes to the `.bat` file. They can copy the `.bat` file verbatim, run it, and have it work just fine.

Are you saying that you followed the instructions using the `.bat` file verbatim, but got the error message?

(`%~dp0` maps to the drive letter and path of the directory the `.bat` file is run from. So, it shouldn’t matter if you run it from L:/ or E:/ or F:/. The script should automatically detect and use the correct drive letter and directory path. (As I understand it, that is. I don’t use Windows computers.))

* * *

Edit: added:

Yes, the Anki Manual instructions should just work, without any changes to the `.bat` file, if you follow the steps correctly.

Details:

The Anki Manual instructions are written using the example of installing Anki into the `E:\Anki` directory.

1. So, you move/copy the Anki launcher into `E:\Anki\Launcher` and create the `.bat` file as `E:\Anki\Anki.bat`.
2. In the `.bat` file, `%~dp0` will automatically get mapped as `E:\Anki` (the directory the `.bat` file is located in).
3. So, `USB_ROOT` also will get mapped as `E:\Anki`.
4. So, these will be the final mappings:
  - `ANKI_LAUNCHER_VENV_ROOT` will be `E:\Anki\AnkiProgramFiles`
  - `ANKI_LAUNCHER` will be `E:\Anki\Launcher\anki`
  - `ANKI_BASE` will be `E:\Anki\AnkiData`

5. With these set, the Anki launcher will put Anki components into those directories during the subsequent initial installation (when run using the `.bat` file).
6. And, the launcher will run Anki using those directories during subsequent runs (when run using the `.bat` file).
7. The `.bat` file works even if you use a different directory.
  - For example, if you put the launcher and `.bat` file into `F:\Files`, the `.bat` file still works (because `%~dp0` will get mapped to `F:\Files`)
  - And, if you put them directly into `L:\`, it still works (because `%~dp0` will get mapped to `L:\`)

At least that is how I understand things should work. Again, I don’t use Windows.

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 30, 2025, 3:44pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/9 "2025-10-30T15:44:01Z")

</div>

Thank you for your help.  
I kept the anki.bat text as it is given in the instructions, but, when I run the anki.bat, I get a message that Windows can not find `L:\Anki\\Launcher\anki`.  
The instructions say not to put the Anki Launcher in `E:\Anki\Launcher\Anki`.  
What can I do?

 ![2025-10-30](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/8/b8e8b63f47a5fab9defbba76c32e67984b27602a.jpeg)

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [October 30, 2025, 3:53pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/10 "2025-10-30T15:53:59Z")

</div>

You copied/moved the Anki launcher directory so that it is `L:\Anki\Launcher`, and you created the `.bat` file as `L:\Anki\Anki.bat`, correct? (If so, then the `L:\Anki\Launcher\anki` file should exist, as I understand it.)

If not, then where did you put the Anki launcher and/or what are the contents of `L:\Anki\Launcher` when you look at that directory in File Explorer?

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 30, 2025, 4:06pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/11 "2025-10-30T16:06:30Z")

</div>

I put the anki-launcher-25.09-windows.exe into the `L:\Anki\Launcher`. So, the `L:\Anki\Launcher` has just this file. I run it and immediately close it. So there is no `L:\Anki\Launcher\anki` file.  
In fact the instructions confuse me..

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [October 30, 2025, 4:15pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/12 "2025-10-30T16:15:46Z")

</div>

> [@SSp](#):
>
> I put the anki-launcher-25.09-windows.exe into the `L:\Anki\Launcher`.

The instruction doesn’t say to _put_ that installer exe file there, it says to _install_ the launcher there.

Installing Anki from scratch requires first installing the launcher, then running the launcher to install Anki. Run that install program you downloaded and choose a custom location for the install.

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [October 30, 2025, 4:28pm UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/13 "2025-10-30T16:28:01Z")

</div>

> [@BenJamesBen](#):
>
> 1. Download the Anki launcher, and move/copy the launcher into a custom location.

Sorry about that. I didn’t realize that there was an installer program that installs the launcher. So, the instructions should be:

1. Download the Anki launcher installer, and use it to install the launcher in a custom location.

(The confusion is that the procedure involves 2 installs. The first installs the launcher, and then the launcher is used to install Anki itself.)

The instructions seem to indicate that the launcher gets automatically run after the installer installs it. So, step 2 would be:

1. When the launcher window appears, close it without using it to install Anki itself.

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 31, 2025, 9:03am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/14 "2025-10-31T09:03:21Z")

</div>

Excuse me, but I can not figure out what the 2nd step indicates:  
`2. When the launcher appears, close it without installing.`  
After the installation of anki-launcher-25.09-windows.exe, Anki opens. Is this the “launcher” that I have to close? It doesn’t ask for any other installation.

---

<div class="post-metadata">

**Author:** ![SSp](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SSp](https://forums.ankiweb.net/u/SSp)\
**Post date:** [October 31, 2025, 10:12am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/15 "2025-10-31T10:12:29Z")

</div>

Finally, it seems that I’ve done it! I did what I had done the first time, but now it works!  
Thank you all!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [November 30, 2025, 10:13am UTC](https://forums.ankiweb.net/t/error-at-startup-of-anki-portable/67201/16 "2025-11-30T10:13:15Z")

</div>

Closed on November 30, 2025, 10:13am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
