#46233 - 2003-10-01 09:42 AM
Windows 98 Environment Variable
|
Annino
Fresh Scripter
Registered: 2002-01-16
Posts: 6
Loc: Sydney
|
Hi all
Having a bit of an issue with one of my scripts. I'm setting a whole lot of environment variables at the start of my script, one being the HOMESERVER of a user. In another script, run a later on in the login script process, I want to update the Norton Anti Virus client to point to this %HOMESERVER% as it's Parent server. Problem is, when I set the environment variables while logging onto the domain, the variables are not recognised in the later scripts. If I perform a logoff and log on, the %HOMESERVER% variable works. No problems with Windows NT/2000/XP Can Kixtart access environment variables which it has set during the login process? I'bve tried using SETL, SETM, WINSET, and SET. Kixtart version 4.12 and the kxrpc service is installed on all my domain controllers. It just seems that any environment variable which I set during the first login of a PC isn't accessible by the system until windows has completely loaded up.
I'm also having this same problem for a user name envirnment variable getting written to a log file. The env variable is not recognised until the OS has fully loaded. Hmmmm.
Any ideas would be very much appreciated.
|
|
Top
|
|
|
|
#46234 - 2003-10-01 02:41 PM
Re: Windows 98 Environment Variable
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You should no longer need PUTINENV/WINSET to accomplish this..
SET should work straight away.. And if we look at the 4.12 Docs, it states that too. quote:
On Windows 9x, sets environment variables in the global Windows environment (similar to the functionality offered by WINSET.EXE).
Can your post your code to set the enviroment variables?
Kent
|
|
Top
|
|
|
|
#46237 - 2003-10-02 02:06 AM
Re: Windows 98 Environment Variable
|
Annino
Fresh Scripter
Registered: 2002-01-16
Posts: 6
Loc: Sydney
|
Here's a excerpt from the script. The reason I was trying to use an environment variable is so that if someone that is not familiar with the script looks at the script N.A.V. update script, they'll more than likely know what %HOMESERVER% is compared to something like $HOMESERVER. Like I said before though, it's strange that the %HOMESERVER% env variable isn't set ubntil the OS has fully completed loading. Even if you do a logoff and log back on, the env variable works. It just that initial time from when the PC is first powered up. I'll use the Kix variable for the time being as a work around.
Thanks for your feedback guys. Below is an excerpt from the two scripts. The Set Env Vars script, and the script that gets called later on to update the N.A.V. client. Each of our server names has been kept to an 8 character standard.
; SetEnvVars.Kix ; --------------
$U = "Unknown"
$HOMESHARE=UCASE(@HOMESHR) IF $HOMESHARE $HOMESERVER=SUBSTR($HOMESHARE,3,8) ENDIF
IF $HOMESERVER SETL "HOMESERVER=$HOMESERVER" SET "HOMESERVER=$HOMESERVER" SETM "HOMESERVER=$HOMESERVER" SHELL "%COMSPEC% /C $WINSET HOMESERVER=$HOMESERVER" ELSE SETL "HOMESERVER=$U" SHELL "%COMSPEC% /C $WINSET HOMESERVER=$U" $HOMESERVER=$U ENDIF ? " Windows NT Home Server : " + $HOMESERVER
; NAVGRCUpdate.Kix ; ----------------
$KEYVALUE = READVALUE("HKLM\SOFTWARE\CCA\NAV","ParentServer")
IF $KEYVALUE <> %HOMESERVER% SELECT CASE @PRODUCTTYPE = "Windows 95" or @PRODUCTTYPE = "Windows 98" or @PRODUCTTYPE = "Windows Me"
If EXIST ("C:\Program Files\Norton AntiVirus") COPY "\\%HOMESERVER%\VPHOME\GRC.dat" "C:\Program Files\Norton AntiVirus\" WRITEVALUE("HKLM\SOFTWARE\CCA\NAV","ParentServer","%HOMESERVER%","REG_SZ") Else If $KEYVALUE = "NO" GOTO "END" Else GOSUB UPDATELOGFILE WRITEVALUE("HKLM\SOFTWARE\CCA\NAV","ParentServer","NO","REG_SZ") EndIf EndIf [ 02. October 2003, 02:11: Message edited by: Annino ]
|
|
Top
|
|
|
|
#46239 - 2003-10-02 02:48 AM
Re: Windows 98 Environment Variable
|
Annino
Fresh Scripter
Registered: 2002-01-16
Posts: 6
Loc: Sydney
|
Excellent point about hard coding a path into the script. Not normally my method but just wanted to get this working initially. I've been testing with NAV 7.5 and decided to try an install of NAV 8.0 and it installs to a different path so thanks for pointing that out.
Also, you're right about the fact that somebody shouldn't be looking at the login scripts unless they know what they're doing. Only two of us have authority to modify the scripts so we keep it pretty secure.
I'll use the $HOMESERVER variable for the moment and will post a resolution if I find one.
Thanks again for the feedback.
|
|
Top
|
|
|
|
#46243 - 2003-10-02 03:29 AM
Re: Windows 98 Environment Variable
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
I'm curious about that Parent Server key you are reading.
Is that some other non Corporate Edtion of SAV/NAV ?
For you Windows 9x systems you could also modify the Registry directly during logon if you want.
Maybe check the IP Range and set the Parent Server based on that.
You could also set parent server only and not download a GRC.DAT as they seem to sometimes be problematic.
Simply set the Parent during every logon.
$Parent='yourParentservername'
$RC=WRITEVALUE('\HKLM\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion', 'Parent', $Parent, 'REG_SZ')
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1821 anonymous users online.
|
|
|