I am having two issues with the script below. This is my first script so please be gentle. I am using KiXforms to create the form and then modified the script from there.
Issue 1. The script runs fine on my machine but when I set another user to execute the same script at login he gets the following error
Quote:

Unexpected command FormLogin.kix Line 14




Here are lines 1 - 24

Code:
Break On
$System = CreateObject("Kixtart.System")

$Form = CreateObject("Kixtart.Form")
;If Not $System
; $= MessageBox("Script Processor Not Initiated. This Script Will Now Install it for you.","Error",16)
; InstKixForms()
;EndIf

;KD START

;************* Form **************
$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.ControlBox = "False"
$Form.Height = 361
$Form.Left = 216
$Form.MaximizeBox = "False"
$Form.MinimizeBox = "False"
$Form.Text = "Welcome to the DCT Domain"
$Form.Top = 95
$Form.TopMost = "True"
$Form.Width = 663
;**************************************



After getting this part to work on other machines I know that I need to modify my MapDrives Function but I will do that later.

Issue 2. I can not find any examples here or other places that would allow me to replace one of my labels with a control and the script that would allow me to load the contents of an RTF fiel . Basically this login script welcomes the user and will list some basic rules of our network. If they hit the accept button the script contines to map drives and ends. If they reject it then as youc an see I have an attempt to reboot their machines.

Here is the entire script, Many thanks to others who have posted scripts that I was able to derive this from.



Code:
 Break On
$System = CreateObject("Kixtart.System")

$Form = CreateObject("Kixtart.Form")
;If Not $System
; $= MessageBox("Script Processor Not Initiated. This Script Will Now Install it for you.","Error",16)
; InstKixForms()
;EndIf

;KD START

;************* Form **************
$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.ControlBox = "False"
$Form.Height = 361
$Form.Left = 216
$Form.MaximizeBox = "False"
$Form.MinimizeBox = "False"
$Form.Text = "Welcome to the DCT Domain"
$Form.Top = 95
$Form.TopMost = "True"
$Form.Width = 663
;**************************************

;************* picLogo **************
$picLogo = $Form.Controls.PictureBox()
$picLogo.BackColor = 212,208,200
$picLogo.BorderStyle = 0
$picLogo.Height = 105
$picLogo.Left = 0
$picLogo.Picture = "itw.bmp"
$picLogo.Top = 0
$picLogo.Width = 655
;**************************************

;************* Label1 **************
$Label1 = $Form.Controls.Label()
$Label1.BackColor = 212,208,200
$Label1.FontBold = "True"
$Label1.FontName = "Tahoma"
$Label1.FontSize = 10
$Label1.Height = 51
$Label1.Left = 0
$Label1.Text = "This network is intended blah blah blah"
$Label1.Top = 135
$Label1.Width = 656
;**************************************

;************* Label2 **************
$Label2 = $Form.Controls.Label()
$Label2.BackColor = 212,208,200
$Label2.FontBold = "True"
$Label2.FontName = "Tahoma"
$Label2.FontSize = 10
$Label2.Height = 33
$Label2.Left = 0
$Label2.Text = "By clicking below and continuing to sign in you accept the terms of the network useage policy."
$Label2.Top = 195
$Label2.Width = 658
;**************************************

;************* cmdAccept **************
$cmdAccept = $Form.Controls.Button()
$cmdAccept.Height = 23
$cmdAccept.Left = 60
$cmdAccept.Text = "Accept Terms"
$cmdAccept.Top = 270
$cmdAccept.Width = 150
$cmdAccept.OnClick = "cmdAccept_Click()"
;**************************************

;************* cmdDecline **************
$cmdDecline = $Form.Controls.Button()
$cmdDecline.Height = 23
$cmdDecline.Left = 450
$cmdDecline.Text = "Decline"
$cmdDecline.Top = 270
$cmdDecline.Width = 150
$cmdDecline.OnClick = "cmdDecline_Click()"
;**************************************

;************* lblName **************
$lblName = $Form.Controls.Label()
$lblName.BackColor = 212,208,200
$lblName.FontBold = "True"
$lblName.FontName = "Tahoma"
$lblName.FontSize = 10
$lblName.Height = 25
$lblName.Left = 0
$lblName.Text = ""
$lblName.Top = 105
$lblName.Width = 483
;**************************************


;KD END
$Form.Center
$Form.show

;Startup

While $Form.Visible
$lblName.text = "Hello " + @FULLNAME + " Welcome to " + @LDOMAIN
$=Execute($Form.DoEvents())
Loop
Exit 1

;****************************************************************
;Functions
;****************************************************************

Function cmdDecline_Click()
;User did not accept the terms
use "*" /delete
if INSTR(@PRODUCTTYPE,"Server") or INSTR(@PRODUCTTYPE,"XP") or INSTR(@PRODUCTTYPE,"2000")
SHUTDOWN("","User did not accept the Terms, Shutting down.",5,1,1)
else
SHELL "%windir%\RUNDLL32.EXE user.exe,EXITWINDOWS"
endif



EndFunction

Function cmdAccept_Click()
use "*" /delete
MapDrives()
Quit 5

EndFunction

Function MapDrives()
If InGroup("Domain Admins")
use h: "\\nb-resources\sales_data"
use s: "\\macolasql\macapps"
use n: "\\dctfs\dli_std1"
use p: "\\nb-resources\data"
use u: "\\nb-resources\OrderScan"
use z: "\\nb-resources\IS_Division"
EndIf
EndFunction

Function InstKixForms
; Install KixForm.dll and Register the dll
If Not Exist ("%windir%\KixForms.dll")
COPY "@LSERVER\NETLOGON\KixStart\KIXFORMS.DLL" "%Windir%"
SHELL "REGSVR32 /S %WinDir%\KIXFORMS.DLL"
EndIf
EndFunction