# Install Elastic Agent on Windows from a read-only smb share

**URL:** <https://discuss.elastic.co/t/install-elastic-agent-on-windows-from-a-read-only-smb-share/316287>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [October 11, 2022, 8:35am UTC](https://discuss.elastic.co/t/install-elastic-agent-on-windows-from-a-read-only-smb-share/316287 "2022-10-11T08:35:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moschur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moschur/32/111885_2.png) [@moschur](https://discuss.elastic.co/u/moschur)\
**Post date:** [October 11, 2022, 8:35am UTC](https://discuss.elastic.co/t/install-elastic-agent-on-windows-from-a-read-only-smb-share/316287/1 "2022-10-11T08:35:34Z")

</div>

Hello!  
we are trying to install Elastic Agent (fleet-managed) on Windows using our software distribution tool. For this, we place the installation files on a read-only smb share. During installation, this share is mounted to the target system and from there the elastic-agent.exe is installed:

`G:\PathToElasticAgent-Installationfiles-OnMountedSMBShare\elastic-agent.exe install --url=https://fleetserver:8220 --non-interactive --enrollment-token=XXX`

This results in an error (the process attempts to write an agent.lock file to the read-only directory):  
`Error: open G:\PathToElasticAgent-Installationfiles-OnMountedSMBShare\data\agent.lock: Access is denied`

Is there any way to install the agent from a read-only directory? Or is the only solution to copy all necessary files to a (local) writeable directory before installation?

---

<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:** [November 8, 2022, 8:36am UTC](https://discuss.elastic.co/t/install-elastic-agent-on-windows-from-a-read-only-smb-share/316287/2 "2022-11-08T08:36:28Z")

</div>

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