KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Logon Script
Goto page Previous  1, 2
 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Thu Sep 18, 2003 1:54 pm    Post subject: Reply with quote

Exactly Cunning
_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Thu Sep 18, 2003 2:02 pm    Post subject: Reply with quote

Ah, need to reply faster Wink
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Thu Sep 18, 2003 6:23 pm    Post subject: Reply with quote

Jochen

I am not obtaining to execute its tip for the clock. What you it indicated happens the same thing with what I made.

It is necessary to declare plus some variable?
It is certain also "$$" and "@@"?

I am not obtaining no information in the Net with examples of the Event "OnTimer". Which the description for this its line?
$$tmrTime.OnTimer = "$$lblTime.Text = @@TIME"
________
Ship Sale


Last edited by dasiguer on Mon Mar 07, 2011 6:35 am; edited 1 time in total
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Sep 19, 2003 7:11 am    Post subject: Reply with quote

Slightly confused here.

From what you say I must assume that you don't have an event execution loop in your script.

You'll see that this works if you run this :

Code:
break on

$frmMain             = createobject("Kixtart.form")
$frmMain.Size        = 640,480

$lblTime             = $frmMain.Label(@time,308,10,80,25)
$lblTime.Borderstyle = 0

$tmrTime             = $frmMain.Timer
$tmrTime.Interval    = 1000
$tmrTime.Enabled     = 1
$tmrTime.OnTimer     = "$$lblTime.Text = @@TIME"

$frmMain.Show

while $frmMain.Visible
    $_ = execute($frmMain.DoEvents)
loop

exit 1


The doubled $'s and @'s are there because the event execution is done by the execute() function.

does this help ?

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Fri Sep 19, 2003 11:31 am    Post subject: Reply with quote

As a general comment, it is very hard to help you if you don't even post the complete code. Additionally, much on what we commented on is covered in either the KIXtart Manual or the KiXforms CHM help file. There are also great examples on both the KiXforms site and htttp://www.kixtart.org that illustrate the use of KiXforms.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Fri Sep 19, 2003 2:26 pm    Post subject: Reply with quote

Yes, it functioned!
But a problem occurs. In my Script it has setting the hour of the server, mapping of drives and execution of archives reg.
When I place this its code,


$frmMain.Show

while $frmMain.Visible
$_ = execute($frmMain.DoEvents)
loop

exit 1


the clock is counting, but all the functions are stops waiting the ending of this code.

I followed the suggestion of Sealeopard, but as still I am lay in the subject, having some difficulties to execute this Script.

The Code for execution of the functions is:


$frmMain.Show

$prgStatus.Max = Ubound($FuncToExecute)+1
For Each $sFunction in $FuncToExecute
$prgStatus.Value = $prgStatus.Value+1
$nul = Execute($sFunction)
Next

Exit()


How must be placed this its code in my code of execution of the functions, since that the clock is not motionless or the functions do not leave of being executed?

Thanks again!
________
Valium rehab advice


Last edited by dasiguer on Mon Mar 07, 2011 6:35 am; edited 1 time in total
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Sep 19, 2003 2:36 pm    Post subject: Reply with quote

Well,

If I were you I would leave out the clock thing completely Wink
If you still want it you could trigger the forms' event execution in asynchronous mode just like this :

Code:
$frmMain.Show

$prgStatus.Max = Ubound($FuncToExecute)+1
For Each $sFunction in $FuncToExecute
    $nul = execute($frmMain.DoEvents(1))
    $prgStatus.Value = $prgStatus.Value+1
    $nul = Execute($sFunction)
Next

Exit()


Which would not wait for the next event to happen but continuing script execution.

On the other side (depending on the tasks to perform) the accuracy of that clock display will decrease more or less.
Think you should just try that and see what happens

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Fri Sep 19, 2003 2:43 pm    Post subject: Reply with quote

Setting
Code:
$frmMain.Visible=0
at the exit points of your script will exit the DoEvents loop and exit the script. As you still haven't posted your code it's hard to say where the exit points are.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Fri Sep 19, 2003 3:50 pm    Post subject: Reply with quote

It did not function, but to decide this problem, this is complete mine script.
Jochen, its last code is not in this script.

if @userid="teste2"
if @producttype="Windows 98"

Break On Cls ;- Remove CLS if using WKIX32
$nul=SetConsole("Hide") ;- Hide console when script is done

;===========
;= Saudacao =
;===========
$Hour = SubStr("@TIME",1,2)
Select
Case Val("$Hour") < 12
$Saudacao = "Bom Dia"
Case Val("$Hour") > 18
$Saudacao = "Boa Noite"
Case 1
$Saudacao = "Boa Tarde"
EndSelect

;====================
;= Declaracao das Funcoes =
;====================

$FuncToExecute=Split("user1,user2,user3,user4",",")

;===========================================
;= Instala automaticamente a Biblioteca necessaria para o KIX.=
;===========================================

shell "c:\windows\system\regsvr32 /s \\Dell_Server\KiXtart\DLL\kixforms.dll"

;=================
;= Formulario do Menu =
;=================
$frmMain = CreateObject("Kixtart.Form")
$frmMain.Size = 370,280
$frmMain.Center
$frmMain.Text = "Script de Logon da Rede"
$frmMain.SysMenu = 0 ; Desabilita as op??es Minimizar,Maximizar,Fechar

$frmMain.Picture = \\DELL_SERVER\KiXtart\Logo\logotipo2.bmp

;=======================
;= Mostrando a Data e o Relogio =
;=======================

$lblDay = $frmMain.Label("@DAY, @MDAYNO of @MONTH of @YEAR",180,5,175,15)
$lblDay.Alignment = 1
$lblDay.Borderstyle = 0

$lblTime = $frmMain.Label(@time,310,20,45,15)
$lblTime.Alignment = 1
$lblTime.Borderstyle = 0

$tmrTime = $frmMain.Timer
$tmrTime.Interval = 1000
$tmrTime.Enabled = 1
$tmrTime.OnTimer = "$$lblTime.Text = @@TIME"

;=================
;= Saudacao e Usuario =
;=================

$lblFName = $frmMain.Label("$Saudacao @FULLNAME!",5,35,350,25)
$lblFName.ForeColor = $frmMain.RGB(0,0,0)
$lblFName.Alignment = 2
$lblFName.FontSize = 15
$lblFName.FontBold = 1
$lblFName.BorderStyle = 0

$lblAdvNut = $frmMain.Label("WELCOME",3,60,356,25)
$lblAdvNut.ForeColor = $frmMain.RGB(0,0,0)
$lblAdvNut.Alignment = 2
$lblAdvNut.FontSize = 11.5
$lblAdvNut.FontBold = 1
$lblAdvNut.BorderStyle = 0

;===================
;= Informacoes do Usuario =
;===================
$fraUser = $frmMain.Frame
$fraUser.Size = 350,90
$fraUser.Text = "Informa??es do usu?rio:"
$fraUser.Alignment = 2
$fraUser.Center
$fraUser.FontBold = 0
$fraUser.FontSize = 8

$lblUserID = $fraUser.Label("Usu?rio:",10,20,70,20)
$lblUserID.Alignment = 0
$lblUserID.FontBold = 0
$lblUserID.FontSize = 10
$lblUserID.ForeColor = $frmMain.RGB(0,0,0)

$lblUserID2 = $fraUser.label(LCase(@USERID),80,20,185,20)
$lblUserID2.Alignment = 0
$lblUserID2.FontBold = 0
$lblUserID2.FontSize = 10
$lblUserID2.ForeColor = $frmMain.RGB(0,0,128)

$lblLServer = $fraUser.Label("Servidor:",10,42,70,20)
$lblLServer.Alignment = 0
$lblLServer.FontBold = 0
$lblLServer.FontSize = 10
$lblLServer.ForeColor = $frmMain.RGB(0,0,0)

$lblLServer2 = $fraUser.label(@LSERVER,80,42,185,20)
$lblLServer2.Alignment = 0
$lblLServer2.FontBold = 0
$lblLServer2.FontSize = 10
$lblLServer2.ForeColor = $frmMain.RGB(0,0,128)

$lblLDom = $fraUser.Label("Dom?nio:",10,64,70,20)
$lblLDom.Alignment = 0
$lblLDom.FontBold = 0
$lblLDom.FontSize = 10
$lblLDom.ForeColor = $frmMain.RGB(0,0,0)

$lblLDom2 = $fraUser.Label(LCase(@DOMAIN),80,64,185,20)
$lblLDom2.Alignment = 0
$lblLDom2.FontBold = 0
$lblLDom2.FontSize = 10
$lblLDom2.ForeColor = $frmMain.RGB(0,0,128)

;=========================
;= Status do Logon e Progress Bar =
;=========================
$fraStatus = $frmMain.Frame
$fraStatus.FontBold = 0
$fraStatus.FontSize = 8
$fraStatus.Alignment = 2
$fraStatus.Size = 350,70
$fraStatus.Center
$fraStatus.Top = $fraUser.Bottom + 5
$fraStatus.Text = "Aguarde enquanto o script de logon est? sendo executado!"

$lblStatus = $fraStatus.Label("Processando logonscript...",10,20,260,20)

$prgStatus = $fraStatus.ProgressBar
$prgStatus.Size = 330,20
$prgStatus.Center
$prgStatus.Top = $lblStatus.Bottom

;===================================
;= Status da Funcao e Formulario do Progress Bar =
;===================================
$frmFuncStatus = CreateObject("Kixtart.Form")
$frmFuncStatus.Size = 300,80
$frmFuncStatus.Center
$frmFuncStatus.Top = $frmFuncStatus.Top + ($frmMain.Height/2)+50
$frmFuncStatus.SysMenu = 0 ; Desabilita as op??es Minimizar,Maximizar,Fechar
$frmFuncStatus.Text = "Processando script de rede..."

$lblFuncStatus = $frmFuncStatus.Label("Processando script de rede...")
$lblFuncStatus.Size = 280,20
$lblFuncStatus.Center
$lblFuncStatus.Top = 5

$prgFuncStatus = $frmFuncStatus.ProgressBar
$prgFuncStatus.Size = 280,20
$prgFuncStatus.Center
$prgFuncStatus.Top = $lblFuncStatus.Bottom

;=========================
;= Script de Execucao das Funcoes =
;=========================
$frmMain.Show

$prgStatus.Max = Ubound($FuncToExecute)+1
For Each $sFunction in $FuncToExecute
$prgStatus.Value = $prgStatus.Value+1
$nul = Execute($sFunction)
Sleep 1
Next

Exit()

$lblStatus.FontBold = 0
$lblStatus.FontSize = 8

;=================
;= Script das Funcoes =
;=================
Function user1()
$lblStatus.Text = "Sincronizando o rel?gio com o Servidor..."
shell "net time \\DELL_SERVER /set /y"
sleep 1
EndFunction

Function user2()
$lblStatus.Text = "Mapeando os drives da rede..."

$sNetDrives=Split("H,I,J,L,M,S",",")
shell "net use h: \\dell_server\guer /yes"
shell "net use i: \\dell_server\info /yes"
shell "net use j: \\dell_server\cdrom /yes"
shell "net use l: \\dell_server\informatica /yes"
shell "net use m: \\dell_server\manualsiga /yes"
shell "net use s: \\dell_server\ap6 /yes"

$frmFuncStatus.Text = "Mapeando os drives da rede..."
$prgFuncStatus.Max = Ubound($sNetDrives)+1
$prgFuncStatus.Value = ""
$frmFuncStatus.Show
Sleep 1
For Each $sDrive in $sNetDrives
$prgFuncStatus.Value = $prgFuncStatus.Value + 1
$lblFuncStatus.Text = "Mapeando $sDrive:\"
Sleep 0.5
Next
$frmFuncStatus.Hide
Exit()
EndFunction

Function user3()
$lblStatus.Text = "Aplicando diretivas no registro..."
shell "regedit /s \\dell_server\KiXtart\registryfiles\driveicons.reg"
shell "regedit /s \\dell_server\KiXtart\registryfiles\windowtitle_ie.reg"
shell "regedit /s \\dell_server\KiXtart\registryfiles\Propriedades_do_Video_Desativa.reg"
shell "delpaper.bat"
Sleep 1
EndFunction

Function user4()
$lblStatus.Text = "Script de logon executado com sucesso!"
Sleep 2
EndFunction

endif
endif

exit
________
Islero


Last edited by dasiguer on Tue Feb 15, 2011 12:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Fri Sep 19, 2003 4:02 pm    Post subject: Reply with quote

First of all, you would make it easier to read your code if you posted it in between CODe tags and use indentation.

Not sure about the first two lines but I guess the eNDIFs are missing. What's the purpose of those?

The CLS and sETCONSOLE are incorrect, as kiXforms scripts should be called with WKIX32 and there should be no console output at all.

$FuncToExecute=Split("user1,user2,user3,user4",",") can be simplified, it's illustrated in the KiXtart Manual inthe seciot about strigs and arrays.

KiXforms registryation requires admin privileges and the DLL belongs into %WINDIR%\SYSTEM under Windows9x and %WINDIR%\SYSTEM32 under Windows NT/2000/XP/2003.

Setting time under Windows NT/2000/XP/2003 reuqires at least poer user privileges and in general time synchronization shoould rather be achieved though the Windows Time Service, especially in AD. Microsoft has whitepapers on that.

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Fri Sep 19, 2003 6:24 pm    Post subject: Reply with quote

Well, the KiX is still not qualified for all the users. But the Administrator, I and a using TEST created by me have access.
We decide to create a form for one better presentation for all the users in the Logon.
I started to create form, but as I had said that still I am lay in the subject, I also needed aid of the Net of you of this of forum.
Part of that I obtained was here in forum, the Net and the proper site (KiXtart.org, KiXscripts.com and KiXforms.com). Much thing I broke the head to discover as it must be made and as others they had obtained to make.
Until I used one part script offered by a friend of forum and I modified it here in accordance with what we need.
It is functioning perfectly not to be the clock.

Answering its questions:

----------

The two IF's of beginning are for verifying which the user are loging and which the version of the Windows installed in the machine of the user. The ENDIF's is in the end of script. Everything what happens between the IF's and the ENDIF's is in accordance with each user.

----------

In the case of the CLS and of the SetConsole, I modified to

Break On
SetConsole("Hide")

as it is in the manual, but the same thing happens.

----------

The line

$$FuncToExecute=Split("user1,user2,user3,user4",",")

I will verify as I can simplify.

----------

All the machines use Windows 9x here. Therefore, it has an archive 'kixforms.dll' in all the machines in directory 'WINDOWS\SYSTEM'.

The line

shell "c:\windows\system\regsvr32/s \\Dell_Server\KiXtart\DLL\kixforms.dll"

it only serves to install the archive in the machines, so that it appears the KiXform. Already we are providing so that before installing, either copied the archive of the folder '\\Dell_Server\KiXtart\DLL\' for 'WINDOWS\SYSTEM'.

----------

Had the determined systems we have that always to leave definite the hour of the equal Server for all the users. E future we will eliminate the archives .CPL so that the users do not modify date and hour of the machine, for security reasons.

----------

If it has plus some thing missed in this script, I would thank it if it indicated me as I can corrigiz it, since he is helping me very to learn to work with this fantastic script.

Not forgetting as I can make with that the clock counts, independent of another code.

Thanks!
________
MARIJUANA MEDICAL


Last edited by dasiguer on Tue Feb 15, 2011 12:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Tue Sep 23, 2003 2:56 pm    Post subject: Reply with quote

Jochen, still I am imprisoned with the problem of the clock that does not count.
Remembering what you it indicated me,

Code:
$frmMain.Show

while $frmMain.Visible
    $_ = execute($frmMain.DoEvents)
loop

exit 1


How I can include in mine script?

Code:
$frmMain.Show

$prgStatus.Max = Ubound($FuncToExecute)+1
For Each $sFunction in $FuncToExecute
$prgStatus.Value = $prgStatus.Value+1
$nul = Execute($sFunction)
Sleep 1
Next

Exit()


You also it indicated me that I can make thus:

Code:
$frmMain.Show

$prgStatus.Max = Ubound($FuncToExecute)+1
For Each $sFunction in $FuncToExecute
    $nul = execute($frmMain.DoEvents(1))
    $prgStatus.Value = $prgStatus.Value+1
    $nul = Execute($sFunction)
Next

Exit()


But the clock only counts when some function finishes to execute, for example, the clock starts to count (09:53:12) until the first function is executed. While this, the clock stop (09:53:12) and in the ending of this function the clock continues (09:53:45) until starting another function. The clock stop another time (09:53:45) and executes it second function. This occurs until finishing all the functions. Thus the clock comes back to count until finishing script, but in this it has very little time to show the clock counting to the user. If you it will have plus some idea of as to make the clock to count together on the functions, it will be very welcome.

Thank one more time.
________
LOS ANGELES DISPENSARY


Last edited by dasiguer on Tue Feb 15, 2011 12:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Tue Sep 23, 2003 3:06 pm    Post subject: Reply with quote

You need to execute the other functions asyunchronously while the eventloop is running. Otherwise the timer event will not get executed.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dasiguer
KiXforms Follower
KiXforms Follower


Joined: 10 Sep 2003
Posts: 15
Location: Rio de Janeiro, Brazil

PostPosted: Tue Sep 23, 2003 4:12 pm    Post subject: Reply with quote

Do you have some suggestion of as you can write this?
________
Chrysler-plymouth specifications
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group