# Installing agent fail

**URL:** <https://discuss.elastic.co/t/installing-agent-fail/375326>\
**Category:** Elastic Agent\
**Created:** [March 3, 2025, 6:50pm UTC](https://discuss.elastic.co/t/installing-agent-fail/375326 "2025-03-03T18:50:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Msquared](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msquared/32/140341_2.png) [@Msquared](https://discuss.elastic.co/u/Msquared)\
**Post date:** [March 3, 2025, 6:50pm UTC](https://discuss.elastic.co/t/installing-agent-fail/375326/1 "2025-03-03T18:50:08Z")

</div>

Hi All,

I am trying to install agents on windows endpoints in my org but getting the following error, I am running PowerShell/command prompt as admin, but still seems to fail.

"[] Installing Elastic Agent... [0s] Error uninstalling. Printing logs  
Error: error installing package: error setting up install path: failed to create install marker: Could not enable privilege "Restore files and directories"  
For help, please see our troubleshooting guide at [Troubleshoot common problems | Fleet and Elastic Agent Guide [8.15] | Elastic](https://www.elastic.co/guide/en/fleet/8.15/fleet-troubleshooting.html)"

Has anyone seen this before and know if there's a fix?

Thank you!
