Page 1 of 1 1
Topic Options
#1005 - 1999-11-16 10:40 AM Setting Variables in NT
Anonymous
Unregistered


Ok, once again, I ask another possible stupid question. My login script works great for Win9x, and some of the programs that we use need certain variables set in the environment. I use Winset for the 9x OS, but I can't get SET to work in the script for the NT systems.. Is there something I'm missing, I've tried the following:

SET "USER=@USER"
SETM "USER=@USER"
SHELL "SET USER=@USER"

And none of them have set the variable for me.

Top
#1006 - 1999-11-20 01:41 PM Re: Setting Variables in NT
Anonymous
Unregistered


you just have to do like this :

$result=@user

greetz,

Seaman

Top
#1007 - 1999-11-22 04:15 PM Re: Setting Variables in NT
Anonymous
Unregistered


$result=@user sets a string variable within kixtart, but it won't set an environment variable within the OS.. I basically ended up doing a registry key add, and write to get it to stick, was there an easier way?

If $OSVAL = "0"
COLOR g+/n
? "Please wait, Login Script is setting your environment."
? ""

$Result=WRITEVALUE("HKEY_CURRENT_USER\Environment","USER", "%USERNAME%", "REG_EXPAND_SZ")
IF $Result=0
COLOR g+/n
? "User Variable Has Been Set."
SLEEP 1
ELSE
COLOR r+/n
? "User Variable Not Set, Contact an Administrator!"
SLEEP 3
ENDIF

$Result=WRITEVALUE("HKEY_CURRENT_USER\Environment", "PATH", "C:\;C:\WINNT\;C:\WINNT\SYSTEM32;C:\WORK;F:\P\BAT;F:\P\UTIL;F:\CHART\APPL;C:\WP51", "REG_EXPAND_SZ")
IF $Result=0
COLOR g+/n
? "Path Has Been Set."
ELSE
COLOR r+/n
? "Path Has Not Been Set, Contact an Administrator!"
ENDIF
EndIf

If $OSVAL = "1"
COLOR g+/n
? "Please wait, Login Script is setting your environment."
SHELL "Winset.exe USER=@USERID"
SHELL "Winset.exe COMPUTER=@WKSTA"
SHELL "Winset.exe DOMAIN=@DOMAIN"
SHELL "Winset.exe HOMEDIR=@HOMEDIR"
SHELL "Winset.exe LSERVER=@LSERVER"
SHELL "Winset.exe PATH=%PATH%;C:\;C:\WINDOWS\;C:\WP51;C:\WORK;F:\P\BAT;F:\P\UTIL;F:\CHART\APPL"
EndIf

Top
#1008 - 1999-11-23 08:04 AM Re: Setting Variables in NT
Anonymous
Unregistered


ccanevit,

What I found is that,if I use the 'SET' command in a similar way as you do, the
setting will not be active, until I close the command box in which I have ran Kix and open a new command box.
I.o.w.: The 'SET' command is not immediately active in the current 'command prompt'-session.

Regards,

Marc

------------------
M.A.C. Duiker (Marc)
Migration Specialist (MCSE)
Marc.AC.Duiker@ici.com
[img]https://partnering.one.microsoft.com/SecureImages/mcp_c.gif[/img]

Top
#1009 - 1999-11-23 11:16 AM Re: Setting Variables in NT
Anonymous
Unregistered


Ok, I mean, I use the SET command, in the login script, that command box is a totally different command box then any other one I open, and the environment variable is still not set. And I hope not to hear that I have to have the Kixtart RPC running, (which it is running now for those of you who saw me post before)

Anyways, the software my company has developed is a clipper software, which only runs in DOS. So these environment variables are very important to have set.

I currently have them setting, but they don't take effect until a person reboots their system and the system re-reads the registry, since I have to do a registry edit.


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 885 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.048 seconds in which 0.021 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