Page 1 of 1 1
Topic Options
#131448 - 2004-12-16 04:24 PM Maybe an OS issue
misty Offline
Fresh Scripter

Registered: 2004-10-14
Posts: 31
I'm having trouble setting an environment variable with Kixtart in W2K. I need the equivalent of typing "set LINAME=chuck" at the command line. I've got a legacy program that does not look in the registry settings for the environment, so the "new" way of setting them in HKCU will not work.

I have the following code in my script now:
Code:

SET "LINAME=@USERID"



It is indeed working the way it is documented, but if I open a command prompt and type "echo %LINAME%" it doesn't know about the variable.

Is my only alternative to run the command through a batch script? The command doesn't get launched by Kixtart but just by the user when he needs it. I am hoping there is a better way to do this from within my script rather than having to write a batch script and change everyone's shortcut to the program.

Thanks in advance!

Top
#131449 - 2004-12-16 04:41 PM Re: Maybe an OS issue
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
why not write the value to HKEY_CURRENT_USER\Environment. The variable will be present at the next logon.

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#131450 - 2004-12-16 04:42 PM Re: Maybe an OS issue
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Change the code to this:

Code:

Set "liname=" + @USERID




This will give you the correct output when doing an echo %LINAME% at the command prompt.
It worked on my wksta.


Edited by R2D2 (2004-12-16 04:44 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#131451 - 2004-12-16 08:04 PM Re: Maybe an OS issue
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
If the other solutions don't work, try the SETENV .
_________________________
(... better days ahead)

Top
#131452 - 2004-12-16 09:23 PM Re: Maybe an OS issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
the env var is located in HKCU and will be read from there and "set" will do the job for you.
if you can't see that after setting, there is indeed something wrong and most likely with your system.

are you running what OS?
_________________________
!

download KiXnet

Top
#131453 - 2004-12-17 10:47 AM Re: Maybe an OS issue
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:


are you running what OS?





When we take a look at the original post.....

Quote:


I'm having trouble setting an environment variable with Kixtart in W2K.





_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#131454 - 2004-12-17 02:24 PM Re: Maybe an OS issue
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Misty,

How you getting on with this?
Anny luck yet?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

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
1 registered (mole) and 2107 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.132 seconds in which 0.071 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