Page 1 of 1 1
Topic Options
#29137 - 2002-09-18 12:14 AM Amending Environment variable
glwday Offline
Fresh Scripter

Registered: 2002-08-01
Posts: 11
Hello

I am a scripting newbie trying to correct a problem created by a predecessor.

We use kix to deliver packaged applications to user across our site. in one install he use
SETM "path=c:\program Files\Common Files\Autodesk Shared"

But this overwrote the Path variable rather than adding it to the existing entries

I thought I could read the existing value and add the new to it, but I get the error Path not found (76) using the following code
code:
  $path = ReadValue ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment","Path")

$autocad = $path+"c:\program Files\Common Files\Autodesk Shared"

SetM "path=" + $autocad

I would be very grateful for assistance
gary

Top
#29138 - 2002-09-18 12:44 AM Re: Amending Environment variable
Dunc Offline
Getting the hang of it

Registered: 2002-05-25
Posts: 54
Loc: Guildford England
Gary,

What version of kix are you using and on what os. I have tried your code on Windows 2000 using 4.10 and it works fine.

Duncan

Top
#29139 - 2002-09-18 12:47 AM Re: Amending Environment variable
Dunc Offline
Getting the hang of it

Registered: 2002-05-25
Posts: 54
Loc: Guildford England
Gary,

Just spotted a problem. Try this

code:
 


Change this

$autocad = $path+"c:\program Files\Common Files\Autodesk Shared"

to this

$autocad = $path+";c:\program Files\Common Files\Autodesk Shared"


Duncan

Top
#29140 - 2002-09-18 12:47 AM Re: Amending Environment variable
glwday Offline
Fresh Scripter

Registered: 2002-08-01
Posts: 11
Dunc

Thanks for the quick reply, we are still stuck with Kix95 on NT4 sp6

I added the semicolon but it didn't make any difference - sorry
Regards

Gary

[ 17. September 2002, 12:50: Message edited by: glwday ]

Top
#29141 - 2002-09-18 12:49 AM Re: Amending Environment variable
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Gary,

I think you miss the seperating semicolon in your path string :

$autocad = $path+";c:\program Files\Common Files\Autodesk Shared"

btw. if OS is 9x you'll have to shell it out to winset

hth

Jochen

[edit]
huh ! should hit F5 from time to time [Roll Eyes]

[ 17. September 2002, 13:07: Message edited by: jpols ]
_________________________



Top
#29142 - 2002-09-17 04:44 PM Re: Amending Environment variable
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Or upgrade to KiXtart 4.12 Beta 1 which has improved SETx functionality for Windows 9x. This will eliminate the use of WINSET.EXE under Windows 9x.
_________________________
There are two types of vessels, submarines and targets.

Top
#29143 - 2002-09-17 06:53 PM Re: Amending Environment variable
Dunc Offline
Getting the hang of it

Registered: 2002-05-25
Posts: 54
Loc: Guildford England
Gary,

Just tried your script on a Windows NT machine with SP 6a loaded and IE6 running kix32 3.49.

Added the semicolon all ok. When do you get the error. Does kix give you the error or the application when looking for the path?

Duncan

Top
#29144 - 2002-09-18 11:14 AM Re: Amending Environment variable
glwday Offline
Fresh Scripter

Registered: 2002-08-01
Posts: 11
Hi Dunc

I am using KiXscripts and get the error when I try the execute or debug options.

However I amended one of our batch files that usually work to read
kix32.exe pathupdate.kix $RF=%1
and that worked! from which I presume that even though kix32.exe was in c:winnt\system32 KiXscripts couldn,t find it.

Many thanks for your help

Gary

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1188 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.061 seconds in which 0.029 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