Page 1 of 1 1
Topic Options
#56603 - 2001-06-18 05:49 PM Saving and restoring Path
Fugazi Offline
Starting to like KiXtart

Registered: 2001-04-23
Posts: 142
Loc: Pace, Fl.
I am working on setting up a script to push a new software package to about 400 users. Unfortunately the software is overwriting the envirorment path on some NT 4.0 machines. I have tried the following solution:
Before Installation begins this staement runs.

$path = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment","Path")

After installation completes I use this statement to restore the path.

WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment","Path","c:\program files\sbaremotesystem\bin;$path","REG_SZ")

This is working spuratically on test machines. On some I am getting the stored path plus the additional statement but on others I am getting a path statement that reads:

c:\program files\sbaremotesystem\bin;$path

Is there something I am missing in the syntax?


_________________________
I haven't failed. I just found another way that did not work.

Top
#56604 - 2001-06-18 06:30 PM Re: Saving and restoring Path
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
have you tried using this key instead?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

for the users that are getting "$path" in their path statement, chances are they do not have a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\... reg key.

Bryce

------------------
kix.isorg.net

[This message has been edited by Bryce (edited 18 June 2001).]

Top
#56605 - 2001-06-18 08:07 PM Re: Saving and restoring Path
Fugazi Offline
Starting to like KiXtart

Registered: 2001-04-23
Posts: 142
Loc: Pace, Fl.
Thanks for the quick response. This seems to have taken care of my problem. Should have thought of this myself so I will use the excuse that it is Monday.
_________________________
I haven't failed. I just found another way that did not work.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org