# Windows Agent reinstall issue

**URL:** <https://discuss.elastic.co/t/windows-agent-reinstall-issue/360462>\
**Category:** Elastic Agent\
**Created:** [May 29, 2024, 12:27pm UTC](https://discuss.elastic.co/t/windows-agent-reinstall-issue/360462 "2024-05-29T12:27:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir7172](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir7172/32/124326_2.png) [@Vladimir7172](https://discuss.elastic.co/u/Vladimir7172)\
**Post date:** [May 29, 2024, 12:27pm UTC](https://discuss.elastic.co/t/windows-agent-reinstall-issue/360462/1 "2024-05-29T12:27:47Z")

</div>

Hello  
I have a problem with agent on Windows  
The very first time I deleted it, I received the error "Error: Yaml:Line 6: Didn't Find Expected Key". I didn’t bother to figure it out and decided to delete everything according to the guide to which I was given a link in the cmd (stop services and delete the entire folder)  
When trying to install the new agent, the error "Elastic Agent installed but currently broken: service exist but installation path is missing" appears, then "Failed to install service: Service Elastic Agent Already Exists".  
sc stop, sc delete commands stops service but do not delete it  
I also cannot reboot the machine because this is a production environment  
I don’t delete service through the registry because a reboot is still will be needed  
I also tried the --force commands on install and uninstall, but without success.  
How can I remove the service or force the agent to reinstall?
