I’m trying to use a command line implementation to change the PATH environment variable to remove a path, so I don’t have to manually remove it on a bunch of machines.
I have found this, which I can’t seem to get it to work:
%Path:str1=str2%
str1 is the path and str2 is null, which I’m not sure how to set it to null on the command line.
If there is another way, I would be glad to give it a try.
Using VBScript, you can get the path variable:
Then split to get an array of the pieces:
Set any entries to an empty string to remove them:
Then reconstruct the path: