Reputation: 33607
I have a .bat script. It runs some commands and alters/adds some environment variables. Then, at some point I need to revert them all to default as if I'm exiting this script and starting a new one from scratch.
So, I need one of the two:
1. either clear the variables (restore defaults that a fresh cmd
session gets);
2. or push
all the variables when I start the script and pop
later to revert to these values.
How can I do that?
Upvotes: 2
Views: 1639
Reputation: 186
Have you tried using SETLOCAL? Here is some information on it: http://ss64.com/nt/setlocal.html
Upvotes: 7