I have a batch file that modifies the PATH variable by adding multiple addresses. When the user logs out, PATH is reset to its original value (before the batch file was ever executed). This is normal.
However, if the batch file is run more than once, the same values ββare re-added, and I get an excessively long redundant PATH variable, which simply increases after each run of the batch.
I would like the reset variable to be what it is when the user logs in before the values ββare added. I believe the solution is to write the original value in a temporary file and read it back, but is there a better way to do this?
source share