# Renewing Certificats and configuring on windows 10

**URL:** <https://community.letsencrypt.org/t/renewing-certificats-and-configuring-on-windows-10/152593>\
**Category:** Help\
**Created:** [May 27, 2021, 7:46am UTC](https://community.letsencrypt.org/t/renewing-certificats-and-configuring-on-windows-10/152593 "2021-05-27T07:46:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![\_az](https://avatars.discourse-cdn.com/v4/letter/_/22d042/32.png) [@\_az](https://community.letsencrypt.org/u/_az)\
**Post date:** [May 27, 2021, 8:21am UTC](https://community.letsencrypt.org/t/renewing-certificats-and-configuring-on-windows-10/152593/2 "2021-05-27T08:21:03Z")

</div>

> [@sharmeiri](#):
>
> I am having trouble using the --pre-hook & --post-hook on the conf file (windows)
> 
> certbot renew --pre-hook "net stop apache2.4" --post-hook "net start apache2."  
> I read the documentation but I cannot find the instructions on how to use the conf file in windows.  
> I want to run "net stop apache2" before the renewal.

I think this older advice is not ideal for our Windows users. Sorry! I will try to get it updated to something more appropraite.

In general, it's easiest to include the `--pre-hook` and `--post-hook` when you first create the certificate.

For example:

```
certbot certonly -d example.com --standalone --pre-hook "net.exe stop apache2.4" --post-hook "net.exe start apache2.4"

```

Running this would result in these two lines being present in `C:\Certbot\renewal\example.com.conf`:

```
pre_hook = net.exe stop apache2.4
post_hook = net.exe start apache2.4

```

like this:

![image](https://global.discourse-cdn.com/letsencrypt/original/3X/8/c/8c90dcaa42ce2b95bd3d58cd4e80a2cf15f4fb0a.png)

What you can do is add these lines to this file, and next time Certbot's scheduled renewal task runs, it will appropriately stop and start the Apache server, if renewal is required.

You can then also test renewal with a dry-run, which should appropriately stop and start the Apache server, without you having to tell it to do so every time:

```
certbot renew --dry-run

```

> [@sharmeiri](#):
>
> I also want to change the certificate's location folder. I found this (only for Linux):

May I ask why you would like to do this?

I think in general we would either advise that you either:

1. Use the Certificate symlinks directly. That is, `C:\Certbot\live\example.com\fullchain.pem` and `C:\Certbot\live\example.com\privkey.pem`. They will be automatically updated at renewal.
2. Get Certbot to create a copy of the certificate and private key files, by using a `--deploy-hook` script that wil copy it to the appropriate location. I can help you write one for Windows, if you're interested.

I am not really srue what will happen when modifying the paths in the renewal conf file. It's definitely off the beaten path and I wouldn't be surprised if it causes problems.

---

_[View the full topic](https://community.letsencrypt.org/t/renewing-certificats-and-configuring-on-windows-10/152593)._
