Updated solution with Windows script