Frank said:
Hello Phil,
best approach I've seen so far. Is there a trick to also replace equal signs
or double quotes (or even better: ANY character) using this method?
Best regards,
Frank
Hi, Frank,
If this is a learning experience and you just want to toy with this
topic, you can modify the example I posted to replace equal signs and
see if it works.
On the other hand, if you want something really robust and don't want
to have to worry about 'will it handle character such-and-such?', then
if I were you I would try to put something together using GSAR, which
you can obtain for free from
http://gnuwin32.sourceforge.net/packages/gsar.htm
One basic approach might be to write the environment variables in
question to a file, invoke GSAR to do the change(s), and then read
the changed environment variables from the file.
But, as someone else recently said in this (or some other) newsgroup,
there's definitely more than one way to skin a cat....