dasiguer
Fresh Scripter
Registered: 2003-09-10
Posts: 22
Loc: Rio de Janeiro - Brazil
|
Sorry for all, but mine script is being executed perfectly. But I want to include a clock that is counting during the execution of all script in the same form. I imagined that somebody already had thought about this situation and could have a problem as this. I decided to place the same doubt in another forum, because I thought that here it would have other people who could help me, instead of criticizing me and snob me, only for cause that I am lay in the referring subject to the KiX. In the other forum, I placed an example of script that use here in the company, thinking that somebody could help me with it, but... Then script is here, showing the clock. If you executing, summer that the clock will stop to the executed being each function.
code:
if @userid="user" if @producttype="Windows 98"
Break On SetConsole("Hide")
;============================================================== ;= Instala automaticamente a Biblioteca necessaria para o KIX.= ;==============================================================
shell "c:\windows\system\regsvr32 /s \\Dell_Server\KiXtart\DLL\kixforms.dll"
;============ ;= 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("userA,userB,userC,userD",",")
;====================== ;= Formulario do Menu = ;====================== $frmMain = CreateObject("Kixtart.Form") $frmMain.Size = 370,280 $frmMain.Center $frmMain.Text = "Script de Logon da Rede" $frmMain.SysMenu = 0
$frmMain.Picture = \\DELL_SERVER\KiXtart\Logo\logotipo2.bmp
;================================ ;= Mostrando a Data e o Relogio = ;================================
$lblDay = $frmMain.Label("@DAY, @MDAYNO @MONTH @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("Bem-vindo à Rede",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 $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
;While $frmMain.Visible ; $nul = execute($frmMain.DoEvents) ;Loop
$prgStatus.Max = Ubound($FuncToExecute)+1 For Each $sFunction in $FuncToExecute $nul = execute($frmMain.DoEvents) $prgStatus.Value = $prgStatus.Value+1 $nul = Execute($sFunction) Sleep 1 Next
Exit()
$lblStatus.FontBold = 0 $lblStatus.FontSize = 8
;====================== ;= Script das Funcoes = ;====================== Function guerA() $lblStatus.Text = "Sincronizando o relógio com o Servidor..." shell "net time \\DELL_SERVER /set /y" Sleep 1 EndFunction
Function guerB() $lblStatus.Text = "Mapeando os drives da rede..."
$sNetDrives=Split("H,I,J,L,M,S",",") shell "net use h: \\dell_server\user /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 0.25 For Each $sDrive in $sNetDrives $prgFuncStatus.Value = $prgFuncStatus.Value + 1 $lblFuncStatus.Text = "Mapeando $sDrive:\" Sleep 1 Next $frmFuncStatus.Hide Exit() EndFunction
Function guerC() $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_Ativa.reg" Sleep 1 EndFunction
Function guerD() $lblStatus.Text = "Script de logon executado com sucesso!" Sleep 1 EndFunction
endif endif
The KiX already was qualified for all the users, but without the clock. I am trying to resolve this question with my difficulties, but if some of you will be able to help me would be very grateful. Thanks for the attention of all!
|