Factor out Windows batfile plan logic into a function