# How to get enrollment token when re-install Elasticsearch to Windows

**URL:** <https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314>\
**Category:** Elasticsearch\
**Created:** [January 17, 2023, 10:54am UTC](https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314 "2023-01-17T10:54:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oga](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@oga](https://discuss.elastic.co/u/oga)\
**Post date:** [January 17, 2023, 10:54am UTC](https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314/1 "2023-01-17T10:54:13Z")

</div>

When installing Elasticsarch8.6 on Windows,  
after runnning  
elasticsearch.bat  
I forgot to write down the enrollment token.

To get the enrollment token,delete the elasticsearch directory  
and unzip the elasticsearch and try again run elasticsearch.bat  
but the enrollment token was not displayed.

I'm assuming that the some install data is still remain in other directories.

Can someone tell me, where to delete the folder or files to get the enrollment token.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2023, 1:39am UTC](https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314/2 "2023-01-18T01:39:34Z")

</div>

If you unzipped Elasticsearch to `C:\path\to\Elasticsearch\` you would need to delete `C:\path\to\Elasticsearch\data`, which should show up once you start Elasticsearch and is where the indices it creates are stored.

---

<div class="post-metadata">

**Author:** ![oga](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@oga](https://discuss.elastic.co/u/oga)\
**Post date:** [January 20, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314/3 "2023-01-20T03:36:08Z")

</div>

Thank you for your reply.

I tried , but I could not find token.  
It seems that Elastic does not recognize as first running time.

Farthermore, when work corecctly, some setting are add to elasticserch.yml , but I could not find that.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 17, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-get-enrollment-token-when-re-install-elasticsearch-to-windows/323314/4 "2023-02-17T03:36:30Z")

</div>

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