Hi,
this is a follow up from the "Logon Scripts" thread which was started by me. I am now having a lot of trouble editing the logon script to make a piece of text change to something different.
Code:
;***************************************************************
;***************************************************************
;**
;** NetCare3.2 - D5PS2Z0J Login System
;** Netlogon.kix
;** D5PS2Z0J NetServices
;**
;** Dependencies:
;**
;** Kixforms.dll
;**
;**
$strVersion = "V.3.2.09"
;**
;***************************************************************
;***************************************************************
;** Dim some global vars.
Dim $frmForm
Dim $fraBanner, $fraForm
;Dim $prgProgress
Dim $Hour
;** Set some global vars.
$LSD = @LServer + "\netlogon"
$WaitTime = 1 ;** Time to wait after each task
$DoProgressCalls = 25 ;** Maximum times DoProgress is called
$Step = 100/$DoProgressCalls ;** Increment progress bar
$Blanker = " " ;** Blank captions
;****************
;** START HERE **
;***************
Gosub "CheckDLL"
Gosub "DOFORM"
$frmForm.Show
Call "$LSD\prep.kix"
Call "$LSD\MapDrives.kix"
Call "$LSD\DoAudit.kix"
Call "$LSD\LogUser.kix"
Call "$LSD\DoAntiVirus.kix"
Call "$LSD\time.kix"
Call "$LSD\snd.kix"
Exit 1
;*************
;**END HERE **
;*************
;*************************************************************
;** SUBS BELOW **
;*************************************************************
:CheckDLL
;*****************************************
;** Check that KIXFORMS.DLL is registered and **
;** copy and register if not **
;*****************************************
$ReturnCode = KEYEXIST("HKEY_CLASSES_ROOT\KixTart.Form\CLSID")
IF $ReturnCode = 0 ;** KixForms not registered
;** Copy .DLL
$SourceFile = @LServer + "\netlogon\kixforms.dll"
$Value = ReadValue( "HKLM\System\CurrentControlset\Control\Windows", "SystemDirectory")
$Destination = ExpandEnvironmentVars( $Value )
COPY $SourceFile $Destination
;** Register .DLL silently
$CMDLine = "regsvr32 /s " + $Destination + "\kixforms.dll"
$ObjShell = CreateObject("WScript.Shell")
$ObjShell.run($CMDLine, 1, true)
;** Kill shell object
$ObjShell = nothing
ENDIF
;** Wait for registration to take effect
sleep 2
RETURN
:DoProgress
$prgProgress.value = $prgProgress.value + $Step
Return
:DOFORM
;***************
;** Main form **
;***************
$frmForm = CREATEOBJECT("Kixtart.FORM")
$frmForm.Caption = ("NetCare3.2 - D5PS2Z0J Logon System ")
$frmForm.sysMenu = 0
$frmForm.Height = 300
$frmForm.Width = 450
$frmForm.FontName = "Verdana"
$frmForm.FontSize = 9
$frmForm.center
;*************
;** Banner **
;*************
$fraBanner = $frmForm.PictureBox
;$fraBanner.IMAGE = "C:\my projects\NetCare3\Images\NC32SM.gif"
$fraBanner.BACKCOLOR = $frmForm.RGB(255,255,255)
$fraBanner.WIDTH = $frmForm.width - 4
$fraBanner.HEIGHT = 60
$fraBanner.LEFT = -2
$fraBanner.TOP = -2
;** Draw On the banner **
$fraBanner.FONTSIZE = 14
$fraBanner.FONTNAME = "verdana"
$fraBanner.FONTBOLD = 1
$fraBanner.FONTITALIC = 1
$fraBanner.ForeColor = $frmForm.RGB(0, 0, 200)
$fraBanner.PrintXY (10,0,"Netlogon.kix")
$fraBanner.FontItalic = 0
$fraBanner.FONTSIZE = 8
$fraBanner.ForeColor = $frmForm.RGB(0,0,0)
$fraBanner.PrintXY (10,24,$strVersion +" Powered by KiXforms (Shamil Nunhuck) ")
$fraBanner.FONTSIZE = 9
$fraBanner.PrintXY (10,35,"D5PS2Z0J NetServices")
$fraBanner.FONTBOLD = 0
$fraBanner.FONTSIZE = 10
;******************
;** Progress Bar **
;******************
$prgProgress = $frmForm.ProgressBar
$prgProgress.width = $frmForm.width - 10
$prgProgress.left = 2
$prgProgress.height = 20
$prgProgress.top = 245;$frmForm.height - $prgProgress.height - 5
$prgProgress.style = 1
;****************
;** Main Frame **
;****************
$fraMain = $frmForm.PictureBox
$fraMain.BACKCOLOR = $frmForm.RGB(255,255,255)
$fraMain.WIDTH = $frmForm.width
$fraMain.HEIGHT = 182 ;$frmForm.height - $fraBanner.height - 35
$fraMain.LEFT = -2
$fraMain.TOP = $fraBanner.Height - 5
$lblJob = $fraMain.label
$lblJob.FONTSIZE = 10
$lblJob.top = 80
$lblJob.width = 440 ;fraMain.width - 20
$lblJob.left = 10
$lblTask = $fraMain.label
$lblTask.FONTSIZE = 10
$lblTask.top = 120
$lblTask.width = 440 ;fraMain.width - 20
$lblTask.left = 50
;** Draw on the frame **
;** Greeting
$Hour = val(trim(left(@Time,2)))
If $Hour < 12
$Greeting = "Good Morning @userid "
else
if $Hour < 17
$Greeting = "Good Afternoon @userid"
else
$Greeting = "Good Evening @userid "
endif
endif
$fraMain.FONTSIZE = 11
$fraMain.FONTNAME = "verdana"
$fraMain.FONTBOLD = 1
$fraMain.ForeColor = $frmForm.RGB(0,100,100)
$fraMain.PrintXY (10,10,$Greeting)
$fraMain.printXY (10,40,"Please wait while you logon script executes...")
Return
;*******************************
;*******************************
;** END OF FILE **
;*******************************
;*******************************
I need to change the Please wait while you logon script executes to Logon has been successful in the final code that is called.
Code:
$lblTask.Caption = $Blanker
$lblTask.Caption = " "
play file @ldrive+"chimes.wav"
sleep 2
$prgProgress.value = $prgProgress.value + 5