Dear Eugene, I read your information and I think that your problem can be the usage of drive Z. Drive Z has a special status within windows
with and without network connection.
My suggestion is the usage of drive C first to check the correctness of your script.
With the kixstrip.exe tool of our site we detect a problem with one line. The output of it have we included. The possible cause
can be the type of editor your are using. Some editors inserts automatically a line-wrap.
Correct line:
$last_logon_message="Last logon by '"+$fullname+"' at "+
LCASE(@day)+" "+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+" "+@time
The output of kixstrip with options /debug /print is:
code:
?"- 3-" ?
?"- 4-" ? "Today is " @day ", " @date ". Current Time is " @time
?"- 5-" ?
?"- 6-" SLEEP 4
?"- 8-" $filename=Dir("c:\patches\chg0228.txt")
?"- 9-" IF @error=0
?"- 10-" ?
?"- 11-" ?
?"- 12-" ?
?"- 13-" ? "You have the latest Anti-Virus Definitions installed."
?"- 14-" SLEEP 2
?"- 15-" GOTO LASTUSER
?"- 16-" ELSE
?"- 17-" CALL %0\..\Nav
?"- 18-" ENDIF
?"- 22-" :lastuser
?"- 23-" IF setconsole("hide")
?"- 24-" ENDIF
?"- 37-" $prgrm_version="1.00"
?"- 38-" $prgrm_publication_date="15.3.2001"
?"- 40-" $time_start=@time
?"- 42-" $cr=CHR(10)
?"- 43-" $lf=CHR(13)
?"- 44-" $eol=$lf
?"- 46-" $logon_server="SAPL2"
?"- 47-" $user_drive="Z:"
?"- 49-" IF (@inwin=1)
?"- 50-" $nt_mode="yes"
?"- 51-" ELSE
?"- 52-" $nt_mode="no"
?"- 53-" ENDIF
?"- 54-" IF (len(@ipaddress0)=0)
?"- 55-" $offline_mode="yes"
?"- 56-" ELSE
?"- 57-" $offline_mode="no"
?"- 58-" ENDIF
?"- 64-" $domain=""
?"- 65-" $ldomain=""
?"- 66-" IF ($nt_mode="yes")
?"- 67-" $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 68-" IF (ExistKey($ikey)=0)
?"- 69-" $domain=ReadValue($ikey,"DefaultDomainName")
?"- 70-" ENDIF
?"- 71-" $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 72-" IF (ExistKey($ikey)=0)
?"- 73-" $ldomain=ReadValue($ikey,"CachePrimaryDomain")
?"- 74-" ENDIF
?"- 75-" ELSE
?"- 76-" $ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP2\NetworkProvider"
?"- 77-" IF (ExistKey($ikey)=0)
?"- 78-" $domain=ReadValue($ikey,"AuthenticatingAgent")
?"- 79-" ENDIF
?"- 80-" $ikey="HKEY_LOCAL_MACHINE\Security\Provider"
?"- 81-" IF (ExistKey($ikey)=0)
?"- 82-" $ldomain=ReadValue($ikey,"Container")
?"- 83-" ENDIF
?"- 84-" ENDIF
?"- 85-" IF (len($domain)=0)
?"- 86-" IF (len(@ldomain)<>0)
?"- 87-" $domain=@ldomain
?"- 88-" ELSE
?"- 89-" $domain=@domain
?"- 90-" ENDIF
?"- 91-" IF (len($domain)=0)
?"- 92-" $domain="~domain"
?"- 93-" ENDIF
?"- 94-" ENDIF
?"- 95-" IF (len($ldomain)=0)
?"- 96-" $ldomain=$domain
?"- 97-" ENDIF
?"- 99-" BREAK off
?"- 100-" MD "c:\temp"
?"- 101-" IF (@error=0)
?"- 102-" ENDIF
?"- 103-" IF (RedirectOutput("nul",1)=0)
?"- 104-" ENDIF
?"- 105-" FLUSHKB
?"- 107-" IF ($nt_mode="yes")
?"- 108-" $time_stop=@time
?"- 109-" $log_info="Kixtart-LOG "+$prgrm_version+" script started"
?"- 110-" $log_info=$log_info+" for '"+LCASE(@userid)+"'"
?"- 111-" $log_info=$log_info+" ("+$time_start+" - '"+@ipaddress0+"')"
?"- 112-" IF logevent(0,1,$log_info,"","Kixtart LOG @kix")
?"- 113-" ENDIF
?"- 114-" ENDIF
?"- 116-" IF setconsole("hide")
?"- 117-" ENDIF
?"- 123-" $section=substr(@date,3,2)
?"- 124-" IF (@ydayno<10)
?"- 125-" $section=$section+"00"+@ydayno
?"- 126-" ELSE
?"- 127-" IF (@ydayno<100)
?"- 128-" $section=$section+"0"+@ydayno
?"- 129-" ELSE
?"- 130-" $section=$section+@ydayno
?"- 131-" ENDIF
?"- 132-" ENDIF
?"- 133-" $key=$section+"_"
?"- 134-" $key=$key+substr(@date,3,2)+substr(@date,6,2)+substr(@date,9,2)
?"- 135-" $key=$key+"_"
?"- 136-" $key=$key+@time
?"- 137-" $key=$key+" "+$domain
?"- 139-" $x=""
?"- 140-" $tmp=""
?"- 141-" $tmp_short=""
?"- 143-" IF (len(@ipaddress0)=0)
?"- 144-" $offline_mode="yes"
?"- 145-" IF ($nt_mode="yes")
?"- 146-" $x=$x+"(NT - vs "+$prgrm_version+" - off-line )"
?"- 147-" ELSE
?"- 148-" $x=$x+"(95 - vs "+$prgrm_version+" - off-line )"
?"- 149-" ENDIF
?"- 150-" ELSE
?"- 151-" $offline_mode="no"
?"- 152-" IF (len(@lserver)=0)
?"- 153-" $lserver="~lserver "
?"- 154-" ELSE
?"- 155-" $lserver=@lserver
?"- 156-" ENDIF
?"- 157-" IF (LCASE($domain)=LCASE($ldomain))
?"- 158-" IF ($nt_mode="yes")
?"- 159-" $x=$x+"(NT - vs "+$prgrm_version+" L $domain $lserver)"
?"- 160-" ELSE
?"- 161-" $x=$x+"(95 - vs "+$prgrm_version+" L $domain $lserver)"
?"- 162-" ENDIF
?"- 163-" ELSE
?"- 164-" IF ($nt_mode="yes")
?"- 165-" $x=$x+"(NT - vs "+$prgrm_version+" - $domain $lserver)"
?"- 166-" ELSE
?"- 167-" $x=$x+"(95 - vs "+$prgrm_version+" - $domain $lserver)"
?"- 168-" ENDIF
?"- 169-" ENDIF
?"- 170-" ENDIF
?"- 171-" $tmp_short=$x
?"- 173-" IF (len(@ipaddress0)=15)
?"- 174-" $i=1
?"- 175-" $ip_old=@ipaddress0
?"- 176-" $ip_new=""
?"- 177-" DO
?"- 178-" IF (substr($ip_old,$i,1)<>" ")
?"- 179-" $ip_new=$ip_new+substr($ip_old,$i,1)
?"- 180-" ELSE
?"- 181-" $ip_new=$ip_new+"0"
?"- 182-" ENDIF
?"- 183-" $i=$i+1
?"- 184-" UNTIL ($i>15)
?"- 185-" ELSE
?"- 186-" $ip_new="xxx.xxx.xxx.xxx"
?"- 187-" ENDIF
?"- 188-" $x=$x+" "+$ip_new
?"- 190-" IF (len(@address)=0)
?"- 191-" $address="xxxxxxxxxxxx"
?"- 193-" ELSE
?"- 194-" $address=@address
?"- 197-" ENDIF
?"- 198-" $x=$x+" "+$address
?"- 200-" $user=""
?"- 201-" IF ($nt_mode="yes")
?"- 202-" $ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 203-" IF (ExistKey($ikey)=0)
?"- 204-" $user=ReadValue($ikey,"DefaultUserName")
?"- 205-" ENDIF
?"- 206-" ELSE
?"- 207-" $ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\control"
?"- 208-" IF (ExistKey($ikey)=0)
?"- 209-" $user=ReadValue($ikey,"Current User")
?"- 210-" ENDIF
?"- 211-" ENDIF
?"- 212-" IF (len($user)=0)
?"- 213-" $user=@userid
?"- 214-" IF (len($user)=0)
?"- 215-" $user="~user"
?"- 216-" ENDIF
?"- 217-" ENDIF
?"- 218-" $x=$x+" "+$user
?"- 219-" $tmp_short=$tmp_short+" "+$user
?"- 221-" IF (len(@wksta)=0)
?"- 222-" $x=$x+" ~wksta"
?"- 223-" $tmp_short=$tmp_short+" ~wksta"
?"- 224-" ELSE
?"- 225-" $x=$x+" "+@wksta
?"- 226-" $tmp_short=$tmp_short+" "+@wksta
?"- 227-" ENDIF
?"- 228-" IF (len(@fullname)=0)
?"- 229-" IF (len(@comment)=0)
?"- 230-" $x=$x+" ('~fullname')"
?"- 231-" ELSE
?"- 232-" $x=$x+" ('~fullname'+'"+@comment+"')"
?"- 233-" ENDIF
?"- 234-" $tmp_short=$tmp_short+" '~fullname'"
?"- 235-" $fullname=$user
?"- 236-" ELSE
?"- 237-" IF (len(@comment)=0)
?"- 238-" $x=$x+" ('@fullname')"
?"- 239-" ELSE
?"- 240-" $x=$x+" ('"+@fullname+"'+'"+@comment+"')"
?"- 241-" ENDIF
?"- 242-" $tmp_short=$tmp_short+" '"+@fullname+"'"
?"- 243-" $fullname=$user
?"- 244-" ENDIF
?"- 246-" $admin_user="no"
?"- 247-" IF (INGROUP("Administrators")=1) OR (INGROUP("Administrators")=2)
?"- 248-" $admin_user="yes"
?"- 249-" ENDIF
?"- 250-" IF (INGROUP("Domain Admins")=1) OR (INGROUP("Domain Admins")=2)
?"- 251-" $admin_user="yes"
?"- 252-" ENDIF
?"- 254-" $tmp=$x
?"- 256-" $license="yes"
?"- 262-" $last_logon_message="Last logon by '"+$fullname+"' at "+LCASE(@day)+"
"+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+"
; -------> Warning KIXSTRIP: 262 line incomplete "double quotation". ; -------> Warning KIXSTRIP: 262 line incompleted.
?"- 263-" "+@time
; -------> Warning KIXSTRIP: 263 line incomplete "double quotation".
; -------> Warning KIXSTRIP: 263 line incompleted.
?"- 264-" $last_workstation="Location pc '"+UCASE(@wksta)+"' of domain '"+UCASE($domain)+"'"
?"- 265-" $previous_logon_message="<unknown>"
?"- 266-" $previous_workstation="<unknown>"
?"- 268-" $filename=$user_drive+"\logon.lst"
?"- 269-" IF (exist($filename)=1)
?"- 270-" IF (setfileattr($filename,128)<>0)
?"- 271-" ENDIF
?"- 272-" $previous_logon_message=readprofilestring($filename,"last logon","user")
?"- 273-" $previous_workstation=readprofilestring($filename,"last logon","workstation")
?"- 274-" ENDIF
?"- 275-" IF (writeprofilestring($filename,"last logon","user",$last_logon_message)<>0)
?"- 276-" ? @serror
?"- 277-" ENDIF
?"- 278-" IF (writeprofilestring($filename,"last logon","workstation",$last_workstation)<>0)
?"- 279-" ? @serror
?"- 280-" ENDIF
?"- 281-" IF (setfileattr($filename,7)<>0)
?"- 282-" ? @serror
?"- 283-" ENDIF
?"- 285-" IF (exist($filename)=1)
?"- 286-" IF (len($previous_logon_message)=0)
?"- 287-" $previous_logon_message="<unknown>"
?"- 288-" ENDIF
?"- 289-" ENDIF
?"- 291-" IF ($previous_logon_message<>"<unknown>")
?"- 292-" $msg="Welcome to "+$logon_server+" network"+$lf
?"- 293-" $msg=$msg+$lf
?"- 294-" $msg=$msg+$lf
?"- 295-" $msg="Note: internal systems must be used only for con-"+$lf
?"- 296-" $msg=$msg+" ducting business, or for purpose authorized"+$lf
?"- 297-" $msg=$msg+" by management."+$lf
?"- 298-" $msg=$msg+$lf
?"- 299-" $msg=$msg+"Use is subject to audit at any time by management."+$lf
?"- 300-" $msg=$msg+$lf
?"- 301-" $msg=$msg+$lf
?"- 302-" $msg=$msg+$previous_logon_message+$lf
?"- 303-" IF ($admin_user="yes")
?"- 304-" $msg=$msg+$lf
?"- 305-" $msg=$msg+$previous_workstation
?"- 306-" ENDIF
?"- 308-" IF (MessageBox($msg,$logon_server,64,10)<>0)
?"- 309-" ? @serror
?"- 310-" ENDIF
?"- 311-" ENDIF
?"- 317-" :end_script
?"- 326-" $time_stop=@time
?"- 327-" IF ($nt_mode="yes")
?"- 328-" $log_info="Kixtart-LOG "+$prgrm_version+" script completed successfully"
?"- 329-" $log_info=$log_info+" for '"+LCASE($user)+"' "+UCASE($domain)
?"- 330-" $log_info=$log_info+" ("+$time_start+" - "+$time_stop+" - '"+$ip_new+"')"
?"- 331-" IF (len($fullname)>0)
?"- 332-" $log_info=$log_info+" '"+LCASE($fullname)+"'"
?"- 333-" $log_info=$log_info+" '"+$previous_logon_message+"'"
?"- 334-" $log_info=$log_info+" '"+$previous_workstation+"'"
?"- 335-" ENDIF
?"- 337-" IF logevent(0,1,$log_info,"","Kixtart LOG @kix"+"s")
?"- 338-" ENDIF
?"- 339-" ENDIF
?"- 340-" PLAY "0g500f60t"
?"- 341-" BREAK on
?"- 342-" FLUSHKB
?"- 345-" :end
?"- 346-" QUIT
;($begin)
;
; fri 16-mar-2001 10:31:54
;
;Warning KIXSTRIP: 2 lines are incompleted.
;Warning KIXSTRIP: some lines contains errors or possible errors.
; 2 line incomplete "double quotation".
; 2 line incompleted.
;Informative KIXSTRIP: 54 block_structures found.
;Informative KIXSTRIP: 3 labels found.
;Summary KIXSTRIP: CALL EXIT GOSUB GOTO QUIT RETURN RUN SHELL USE
;Informative KIXSTRIP: 1 CALL
;Informative KIXSTRIP: 1 GOTO
;Informative KIXSTRIP: 1 QUIT
;
;($end)
;($begin)
;
;Warning KIXSTRIP: 262, 263 line incomplete "double quotation".
;Warning KIXSTRIP: 262, 263 line incompleted.
;
;($end)
Remarks:
line 15 "goto lastuser" isn't necessary.
line 17 "CALL %0\..\Nav" change it to "Call %0\..\Nav.KIX".
Q: I do not use roaming profiles in my workplace, but for my testing account, I just set my home directory to z: which connects it to
the Profiles$ share on my server. Would I have to enter the User Profile column as well? or would that not make a difference?
A: The usage of roaming, mandatory or other profiles doesn't influence the script. The problem can be the usage of drive Z.
We suppose that another part of your logon process with map the specified drive.
Q: Are these changes enough? Why isn't anything
showing like what was the last previously logged on time, etc.
I have checked that the logon.lst file does not exist in the Profiles$ directory on the server, even though I have logged on twice. I
have also made sure that the Profiles$ directory I have created allows full control to everybody.
A: The changes are enough. For checking the correctness of rights we copy a simple file from our C-drive to this drive.
Q: There doesn't seem to be an error in the script, 'cos I don't see any red lines that say error.
A: It is possible that the colour will not be changed to red, but it is possible that the call "CALL %0\..\Nav" doesn't return to the
original script.
Another suggestion is to skip temporarily the Norton Antivirus update part by inserting as first line goto lastuser
I'll include a script here for reference. Hope someone can help me.
We hope that it helps you.
Greetings.
BTW:
- this answer was earlier posted by email
- first email reponse:
code:
Thanks for your reaction. A lot of things are written to kixtart.org topic http://kixtart.org/board/Forum1/HTML/001067.html
We are running the script without integration in another script.
We had to change (if necessary) two kixtart variables:
$logon_server which can changed to message box header
$user_drive which must be changed to home directory of user. the file logon.lst in this home directory
will contain information about last logon.
The lines in the script are:
$logon_server="IT company"
$user_drive="s:" ; - variable used by calculation of possible missing "$user" value -
Possible problems can be:
* incorrect $user_drive setting.
* insufficient read/write rights for the user.
* some variables of other code are conflicting.
* some other statements are conflicting.
A way of checking your script is: running our tool kixstrip with option /debug.
During running the script it tells exactly which line are executed.
By running kixstrip you get to know of there are any problem.
A summary of your variables, functions, commands and macro's can be made with the tool kixref.exe.
Our advice is to run the logon.kix script with changes to the variables $user_drive and $logon_server first standalone.
When you have still problem please sent us a copy of your script.
So will we look at it too.