|
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 ]
|