Hi, I am very new to Kix scripting; and I need a lot of help with a login system I will be using on a network. Everytime I run the script I recieve:
Script Error: unknown command !
$fromForm.Caption = " (System) Login"
system is the name of the network
Here is the whole sript in full:
Code:
;***************************************************************
;***************************************************************
;**
;** Network Login
;** Netlogon.kix
;**
;** Dependencies:
;**
;** Kixforms.dll
;**
;** V.3.2.01 28/12/2004
;** V.3.2.02 13/01/2005 Check for and register .DLL
;** V.3.2.03 14/01/2005 Map network drives
;** V.3.2.04 15/01/2005 Log user/station details
;** V.3.2.05 26/02/2005 Fixed problem with incorrect drive mapping displayed
;** V.3.2.06 26/02/2005 Removed display name from greeting
;** V.3.2.07 20/03/2005 Added AV call for Somerset sites
;** V.3.2.08 07/04/2005 Added RegFixes section. Checkfor and install KB888254
;** V.3.2.09 24/05/2005 Split into seperate scripts
;**
$strVersion = "V.3.2.09(b)"
;**
;***************************************************************
;***************************************************************
;** 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\MapDrives.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 = " system Login"
$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, 192)
$fraBanner.PrintXY (10,0,"NetLogon 3.2 : Netlogon.kix")
$fraBanner.FontItalic = 0
$fraBanner.FONTSIZE = 8
$fraBanner.ForeColor = $frmForm.RGB(0,100,100)
$fraBanner.PrintXY (10,20,$strVersion + " Powered by Kixforms ")
$fraBanner.FONTSIZE = 9
$fraBanner.PrintXY (10,35,"D5PS2Z0J Systems")
$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 = 0
;****************
;** 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 "
else
if $Hour < 17
$Greeting = "Good Afternoon "
else
$Greeting = "Good Evening "
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 your logon script executes...")
Return
;*******************************
;*******************************
;** END OF FILE **
;*******************************
;*******************************
Sorry if my reply may be slow; my moden suffered a power surge and I am back on dial-up for the time!
04nunhucks@gmail.com