Use setlocal instead of set. (credit @ilikepi)