I've accumulated a lot of environment variables in my user and system Path. I'm sure some of them don't even exist anymore, so I'm going to check one by one. But is there an automatic way to do it?
Asked
Active
Viewed 185 times
1 Answers
1
There is no native Windows function to perform such a purge.
You would need to make a script which would:
- split the
%PATH%
as described in "How can I use a .bat file to remove specific tokens from thePATH
environment variable?" - build a string for each existing folder
setx PATH=<new string>

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
Yeah figured. If I have to automate this myself, I might as well just manually do it. – Jeffery Tang Jun 02 '21 at 01:44