# I am trying to uninstall elastic search MSI but can't find the elasticsearch-service.bat file

**URL:** <https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [April 4, 2022, 5:10am UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447 "2022-04-04T05:10:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_Abi\_Chedid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierre_abi_chedid/32/97870_2.png) [@Pierre\_Abi\_Chedid](https://discuss.elastic.co/u/Pierre_Abi_Chedid)\
**Post date:** [April 4, 2022, 5:10am UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/1 "2022-04-04T05:10:09Z")

</div>

Hello,

I have been trying to install Elasticsearch using the msi version:  
[https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0.msi](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0.msi)

But I have been encountering problems with setting up the passwords using the bin\Elasticsearch-setup-passwords interactive. It's returning this error:

```auto
Unexpected response code [405] from calling GET http://127.0.0.1:9200/_security/_authenticate?pretty
It doesn't look like the X-Pack security feature is enabled on this Elasticsearch node.
Please check if you have enabled X-Pack security in your elasticsearch.yml configuration file.

ERROR: X-Pack Security is disabled by configuration.

```

After some research, it seemed as though there's some problem with my Elasticsearch.yml file, but I simply cannot find the config file. I didn't change its path during the msi installation process (and frankly I forgot if it was installed in a different folder by default). I wanna try uninstalling Elasticsearch and re-install it but this time make sure of the config folder's location, but it cannot be uninstalled since Elasticsearch is running as a service. I tried to remove the service but there is no Elasticsearch-service.bat file in my bin folder.

Is there a way to locate my config file or uninstall the service?

---

<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:** [April 4, 2022, 7:19am UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/2 "2022-04-04T07:19:03Z")

</div>

Here's the default install locations - [Install Elasticsearch with Windows MSI Installer | Elasticsearch Guide [7.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/windows.html#msi-command-line-options)

---

<div class="post-metadata">

**Author:** ![Pierre\_Abi\_Chedid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierre_abi_chedid/32/97870_2.png) [@Pierre\_Abi\_Chedid](https://discuss.elastic.co/u/Pierre_Abi_Chedid)\
**Post date:** [April 4, 2022, 7:54am UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/3 "2022-04-04T07:54:01Z")

</div>

Thank you! I found the config file, changed the xpack.security.enabled to true, but it's still not working. Here is my Elasticsearch.yml file :

```auto
bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: DESKTOP-ELKL6PC
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: true

```

Is there something I need to do for the changes to take effect? Or any additional configuration that needs to be done?

---

<div class="post-metadata">

**Author:** ![Pierre\_Abi\_Chedid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierre_abi_chedid/32/97870_2.png) [@Pierre\_Abi\_Chedid](https://discuss.elastic.co/u/Pierre_Abi_Chedid)\
**Post date:** [April 5, 2022, 3:23pm UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/4 "2022-04-05T15:23:36Z")

</div>

I found the solution for my problem, for those of you who have the same issue

Run this command with command prompt as administrator:

```auto
sc.exe stop Elasticsearch

```

This will stop the Elasticsearch service, making it possible for your Elasticsearch.yml file changes to take effect. You can restart the service with:

```auto
sc.exe start Elasticsearch

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 5, 2022, 3:45pm UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/5 "2022-04-05T15:45:31Z")

</div>

Thanks for sharing your solution!

---

<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:** [May 3, 2022, 3:46pm UTC](https://discuss.elastic.co/t/i-am-trying-to-uninstall-elastic-search-msi-but-cant-find-the-elasticsearch-service-bat-file/301447/6 "2022-05-03T15:46:29Z")

</div>

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