On Wed, 25 Jan 2006 08:38:03 -0800, "molonede" <
molonede@discussions.microsoft.com>wrote:
¤ Thanks, but that doesn't help me. There is nothing in the setx utility to
¤ remove a portion of the string. I also can not install the utility on the
¤ workstation, I just need an executable that I can run on a workstation. I
¤ have about 500 workstations that I am needing to modify and each workstations
¤ PATH is different, except that they will have a directory in the path that
¤ needs to be removed.
¤
¤ One workstation would have
¤ PATH=c:\winnt\system32;c:\removeme;c:\keepme
¤ Another workstation would have
¤ PATH=c:\win2000\system32;c:\removeme;c:\keepme2;c:\keepme
¤
¤ So I need a stand alone utility that I can run on workstations that would
¤ remove the passed parameter from the PATH
¤ ex.
¤ c:\removepath.exe "c:\removeme"
¤
¤ would result in
¤ One workstation would end up having
¤ PATH=c:\winnt\system32;c:\keepme
¤ Another workstation would end up having
¤ PATH=c:\win2000\system32;c:\keepme2;c:\keepme
No can do. The complete path has to be replaced and reset since the system global environment
variables are loaded into memory. You can read it, modify it and then reset it.
If you don't want to use the SetX utility see the following:
How to propagate environment variables to the system
support.microsoft.com/kb/q104011/">
support.microsoft.com/kb/q104011/
How To Use the Registry API to Save and Retrieve Settings
support.microsoft.com/kb/q145679/">
support.microsoft.com/kb/q145679/
Also keep in mind that system global environment variables are handled differently in the Window
ME/9x versions.
Paul
~~~~
Microsoft MVP (Visual Basic)
-