ported recursive createPath to win