Fixes #5945: add windows support to services

Can we not detect whether a service is started on boot on Windows? If we could, we could just fix this method to support that, and avoid a lot of the modifications below.