windows build fix

I think the implementation is fine ;) It is an improvement over the existing behavior and I want to get rid of ant anyway soon.