Stopping the webserver works fine, it's required in case the certificate gets updated, I think. The new certificate is loaded when it restarts with --post-hook
.
[edit] Actually... I removed those and now it renews properly. I had to add a command to restart apache after renewing the certificate. Although the only reason I had those --pre-hook and --post-hook were because a tutorial said I had to, and it worked on my previous installation.
[edit2] Found something about this on the forums: Renewing Certificats and configuring on windows 10 - #2 by _az
particularly the part where it says I think this older advice is not ideal for our Windows users. Sorry!