Page 2 of 2 <12
Topic Options
#51456 - 2000-12-07 06:07 AM Re: New Logon Script Using OLE!
oyvinn Offline
Fresh Scripter

Registered: 2000-12-05
Posts: 10
Loc: Kongsberg
There seems to be a problem related to IE. I have tried your program on various versions of OS. This is what i have found up to now

KixTart v 3.63
WinNT 4.0 sp 6 , IE 5.0 : Works Great!!
WinNT 4.0 sp1a , IE 4.0 : Access violation problem, can not run at all
Win98 , IE 5.0 , IE starts up with a completely white background, about:blank in title field, but the logon script is executed in the background, but nothing is shown on the screen.

My logon script is still having call to the 4DOS/4NT command processor. I have not been able to find a replacement of this great utility tool! I am attaching my current loogon script (that currently only runs on my own PC. NB the IP-address are not my correct ones.

Another problem with starting IE from the logon script is that it takes approx 35 sec to start up! That is until the first line of HTML code is displayed. Is that normal?

NB this script is not completely debugged under Win9x (still some small errors like DOS boxes not closing etc), but it works great on NT40 (on my machine that is!)


;$nul=Setconsole("maximize")
goto START
; ------------------------------------------------------
; DR NETLOGON file for Win95 and WinNT workstations
;
; This is the logon script used at Dresser-Rand , Kongsberg, Norway
; Due to the differences in Win9x and WinNT, the logon script is split into
; various sections depending upon OS used.
;
; Due to speed problems with dial-up users and users logging in remotely (using
; less than 256KB lines), some applications/functions/downloads are not available for those
; users. To find out if the user is connected to the network from a remote location
; or using a dial-up connection, the following rule apply (MUST test for RAS FIRST!)
;
; if using RAS ==> REMOTEUSER
; IP address not within
; 190.111.8.x
; 190.111.9.x
; 190.111.10.x range ==> REMOTEUSER
; else ==> LOCALUSER
;
; USES:
;
; KIXTART
; KXRPC KiXtart RPC service for Win9x clients. must be installed on ALL logon servers.
; Certain informations and programs (INGROUP) will not be available without this
; service isntalled. To install KXRPC
; KXRPC -install
; start the service on the services control panel window
; 4NT,4DOS Command processor from JP Software for NT (4NT) and Win9x (4DOS)
; HISTORY
;
; 06-11-00 ŘA Translated from 4DOS to KixTart
; -------------------------------------------------------------------------------------
:START
break on
color w/n
small
$false = 0
$true = -1
$WindowTop = 100
$WindowLeft = 100
$WindowWidth = 600
$WindowHeight = 540
$Company = "Dresser-Rand AS"
$Welcome = "Welcome to the $Company Network"
$UserName = @USERID
$FullName = @FullName
$Priv = @Priv
$Wksta = @Wksta
$Domain = @Domain
$LServer = @LServer
;
; Redirect all output to a file
;
if Redirectoutput("c:\temp\logon.log",1) = 0
? "Opened 'logon.log' at " + @TIME ?
endif
$StatusMessage = "Running Logon Script"
$ie = olecreateobject("internetexplorer.application")
;
; Must be running IE !!!!
;
if $ie = 0 exit endif

; Set properties and display form ...

$nul = oleputproperty($ie, "addressbar","s","$false")
$nul = oleputproperty($ie, "menubar", "s", "$false")
$nul = oleputproperty($ie, "toolbar", "s", "$false")
$nul = oleputproperty($ie, "statusbar", "s", "$false")
$nul = oleputproperty($ie, "resizable", "s", "$false")
$nul = oleputproperty($ie, "top", "s", "$WindowTop")
$nul = oleputproperty($ie, "left", "s", "$WindowLeft")
$nul = oleputproperty($ie, "height", "s", "$WindowHeight")
$nul = oleputproperty($ie, "width", "s", "$WindowWidth")
$nul = olecallfunc($ie, "navigate", "s", "about:blank")
while olegetproperty($ie, "busy") <> "0" and @error = 0 loop
if (@INWIN = 1)
$NT_mode="yes"
$4dosexec="c:\4dosnt\4nt.exe"
else
$4dosexec="c:\4dos50\4dos.com"
$NT_mode="no"
endif

;==================================================================================================
; Renewal of IP-addresse from DHCP server
; This is sometimes necessesary to force a renewal of the IP addresses given
; by the DHCP server
; NB! Win95 must use WINIPCFG.EXE for Windows 3.11 for workgroups
; ----------------------------------------------------------------------------------
;if ($NT_mode = "yes")
; run "ipconfig /renew"
;else
; run "winipcfg /batch /Renew_all"
;endif
;
; ----------------------------------------------------------------------------------
; Determine if the connection is RAS
; ----------------------------------------------------------------------------------
if @RAS > 0
goto REMOTEUSER
endif
; ----------------------------------------------------------------------------------
; Determine if the IP addresse (on network adapter 0) is a local
; one, i.e. 190.111.8.x , 190.111.9.x ,190.111.10.x for Domain DRNT01
; 190.111.11.x is used for RAS communication. All other addresses
; are treated as remoteusers
; ----------------------------------------------------------------------------------
$IPADDR=LTRIM(SUBSTR(@IPADDRESS0,1,4))+
LTRIM(SUBSTR(@IPADDRESS0,5,4))+
LTRIM(SUBSTR(@IPADDRESS0,9,4))+
LTRIM(SUBSTR(@IPADDRESS0,13,4))
if INSTR($IPADDR,"190.111.8") <> 0 or INSTR($IPADDR,"190.111.9") <> 0 or INSTR($IPADDR,"190.111.10") <> 0
goto LOCALUSER
else
goto REMOTEUSER
endif
:REMOTEUSER
$LocalUser=No
$LocalInfo=Remotely
goto CONTINUE1
:LOCALUSER
$localUser=YES
$LocalInfo=Locally
:CONTINUE1
; ----------------------------------------------------------------------------------
; Connects to correct logon location .ie
; DRDRMW01 = Drammen
; NT08 = Kongsberg
; ----------------------------------------------------------------------------------
; Default setup for Kongsberg
;
$K_SERVER=DRKBGW02
$P_SERVER=NT02
$W_SERVER=DRKBGW03
if @LSERVER = "\\DRDRMW01"
$LogonSite=DRAMMEN
$K_SERVER=DRDRMW01
$P_SERVER=DRDRMW01
$W_SERVER=DRDRMW01
else
$LogonSite=KONGSBERG
endif
; Get a handle to the open document ...
$doc = val("&" + olegetproperty($ie, "document"))
? "Calling HTML at " + @TIME ?
gosub htmllogon
? "Finishing HTML at " + @TIME ?
$nul = olecallfunc($doc, "write", "s", "$html")
$nul = oleputproperty($ie, "visible", "s", "$true")
$frmMessage = val ( "&" + olecallfunc ( $doc, "getElementById", "s", "frmMessage" ))
$nul = oleputproperty ( $frmMessage, "value", "s", "Start KiXTart Logon script...")
; ----------------------------------------------------------------------------------
; Connects to standard shares
; Due to a bug in Win95 this script sometimes is not run so use /persistent
; to be sure that the drives are available
; ----------------------------------------------------------------------------------
? "Connecting to standard shares " + @TIME ?
IF @INWIN = 1
$dummy=DELKEY("HKEY_CURRENT_USER\Network\R")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\J")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\K")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\L")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\M")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\N")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\V")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\X")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\S")
ELSE
use R: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\R")
use J: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\J")
use K: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\K")
use M: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\M")
use N: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\N")
use V: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\V")
use X: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\X")
use S: /DELETE
$dummy=DELKEY("HKEY_CURRENT_USER\Network\Persistent\S")
ENDIF
$nul = oleputproperty ( $frmMessage, "value", "s", "Connecting to Standard Shares...")
use R: "\\$W_SERVER\winstall" /persistent
use J: "\\NT08\DOCUMENTLIB" /persistent
use K: "\\$K_SERVER\drcommon" /persistent
use L: "\\nt08\projects" /persistent
use M: "\\NT09\ACADLIB" /persistent
use N: "\\nt02\maildisk" /persistent
use V: "\\drkbgw02\database" /persistent
use X: "\\axis29371b\CD" /persistent
use S: "\\nt05\cdprograms" /persistent
; ----------------------------------------------------------------------------------
; Getting time from time server
; ----------------------------------------------------------------------------------
? "Setting time from Time server at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Setting time from DRNT01..")
SETTIME @Lserver
; -----------------------------------------------------
; Skip Logon script if this is a UGWORK station only
; -----------------------------------------------------
if (%UGWORK = "YES" )
RETURN
endif
if ($NT_mode = "yes")
goto WinNT
else
goto Win9x
endif
;======================================================================================
; Main start for WinNT workstations
;======================================================================================
:WinNT
$nul = oleputproperty ( $frmMessage, "value", "s", "WinNT Starting programs..")
? "Starting WinNT logon at " + @TIME ?
if ($LocalUser = "YES")
; -----------------------------------------------
; Distributing Norman Virus control
; -----------------------------------------------
? "Distributing Norman Virus Control at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Distributing Norman for WinNT...")
run $4dosexec + "Start /inv/c r:\nvcadmin\ndist\n_dist r:\nvcadmin\ndist\dr-nvcnt-s.nxd"
; -----------------------------------------------
; Starting Trojan Guard
; -----------------------------------------------
? "Starting Norman Virus control, Trojan Guard at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting Trojan Virus Guard...")
run $4dosexec + "Start /inv/c c:\norman\win32\troguard.exe"
; -----------------------------------------------
; Starting Graphic server for IFS 16 bits problemer
; -----------------------------------------------
? "Starting Graphic Server for IFS at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting Graphic Server for IFS...")
run "k:\ifs\fnd\runtime\gsw16.exe"
; -----------------------------------------------
; Starting OfficeView
; -----------------------------------------------
? "Starting OfficeView at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting OfficeView...")
run "v:\OviewPro\Ovpro.exe"
; -----------------------------------------------
; Downloading Office97 NORMAL.DOT , and datafiles
; -----------------------------------------------
? "Downloading misc files at " + @TIME ?
copy "k:\template\office97\templates\normal.dot" "c:\program files\microsoft office\templates\*.*"
copy "k:\datafil\*.*" "c:\*.*"
; ----------------------------------------------------------------------------------
; Start MESSENGER Service
; ----------------------------------------------------------------------------------
? "Starting Messenger at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting Messenger...")
run $4dosexec + "net start MESSENGER >&nul"
if INGROUP("Kindis")
$dummy=DELKEY("HKEY_CURRENT_USER\Network\T")
use T: \\Tidsreg02\kindisadf /persistent
endif
endif
? "Finished Standard WiNt Logon at " + @TIME ?
goto WinCommon1
:Win9x
;======================================================================================
; Main start for Win9x workstations
;======================================================================================
$nul = oleputproperty ( $frmMessage, "value", "s", "Win9x Starting programs...")
; -----------------------------------------------
; Connect Win9x users to U-drive
; -----------------------------------------------
IF @HOMESHR <> ""
use U: @HOMESHR /PERSISTENT
ENDIF
del "u:\user.dat"
; -----------------------------------------------
if ($LocalUser = "YES" )
; -----------------------------------------------
; Starting Trojan Guard
; -----------------------------------------------
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting Trojan Virus Guard...")
run $4dosexec + "Start /inv/c c:\norman\win32\troguard.exe"
; -----------------------------------------------
; Updating Office97 Templates for Win95
; Office97 NORMAL.DOT
; -----------------------------------------------
copy "k:\template\office97\templates\dresser\*.*" "c:\program files\microsoft office\templates\dresser\*.*"
copy "k:\template\office97\templates\normal.dot" "c:\program files\microsoft office\templates\*.*"
; ----------------------------------------------------------------------------------
; Download data files if modified
; ----------------------------------------------------------------------------------
copy "k:\datafil\*.*" "c:\*.*"
; -----------------------------------------------
; Wininstall 95
; -----------------------------------------------
if EXIST("%windir%\system\basicok.95")
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting WinInstall for Basicok...")
shell "xcopy \\nt08\menyer\dr menyer\win95\*.* %windir%\start menu\*.* /s/q/e"
run "r:\wininstall\winstala.exe r:\wininstall\win95l-auto.lst"
endif
if EXIST("%windir%\system\mimiok.95")
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting WinInstall for Miniok...")
shell "xcopy \\nt08\menyer\dr menyer\win95min\*.* %windir%\start menu\*.* /s/q/e"
run "r:\wininstall\winstala.exe r:\wininstall\win95l-auto-min.lst"
endif
; -----------------------------------------------
; Distributing Norman Virus control
; -----------------------------------------------
$nul = oleputproperty ( $frmMessage, "value", "s", "Distributing Norman for Win9x...")
run "r:\nvcadmin\ndist\n_dist r:\nvcadmin\ndist\nvc95.nxd >&c:\temp\nvstart.log"
; -----------------------------------------------
; Starting Graphic server for IFS 16 bits problemer
; -----------------------------------------------
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting Graphic Server for IFS...")
run "k:\ifs\fnd\runtime\gsw16.exe"
; -----------------------------------------------
; Starting OfficeView
; -----------------------------------------------
$nul = oleputproperty ( $frmMessage, "value", "s", "Starting OfficeView...")
RUN "v:\OviewPro\Ovpro.exe"
; ----------------------------------------------------------------------------------
; Start WINPOPUP
; ----------------------------------------------------------------------------------
;%windir%\winpopup.exe
; --------------------------------------------------------------------
; Get last week run, or create new datefile (date = day -1) if not found
; Nextweek format _DD.MM.YY (where _ is space)
; --------------------------------------------------------------------
$FileName = dir("c:\onceaweek.dat")
if EXIST ($FileName)
else
run $4dosexec + " k:\programs\onceaweek.btm"
endif
Open(1, $FileName,2)
$Nextweek = READLINE(1)
Close(1)
$nextyear ="20"+SUBSTR($NEXTWEEK,8,2)
if (@MDAYNO > SUBSTR($NEXTWEEK,2,2) and @MONTHNO >=SUBSTR($NEXTWEEK,5,2) and @YEAR >=$NextYear)
; ----------------------------------------------------------------------------------
; Backup Mobile users OUTLOOK files only once a week
; ----------------------------------------------------------------------------------
$FileName = dir("U:\OUTLOOK_mob")
if $FileName
$nul = oleputproperty ( $frmMessage, "value", "s", "Backing up Personal Outlook folder...")
run $4dosexec + "Start /inv/c copy/u c:\outlook\*.p* u:\outlook_mob\*.* "
endif
; ----------------------------------------------------------------------------------
; Run full virus check at least once a week
; ----------------------------------------------------------------------------------
$nul = oleputproperty ( $frmMessage, "value", "s", "Runnning full virus check...")
$logfile="\\nt08\c$\norman\infected\"+@WKSTA".log"
run $4dosexec + " c:\norman\win32\nvc32 /ald /cl /lq /lf:"+$logfile$+" /lg /sn /o /u /y "
endif
; -----------------------------------------------
; Update last week run with +7 days
; -----------------------------------------------
run $4dosexec + " k:\programs\onceaweek.btm"
endif

:WinCommon1
if ($LocalUser = "YES")
; -----------------------------------------------------
; Connect to various shares, based on group membership
; -----------------------------------------------------
if INGROUP("AutoCad Users")
? "Downloading modified ACAD files at " + @TIME ?
; -----------------------------------------------
; Downloading New DRESSER ACAD rev14 files
; -----------------------------------------------
run $4dosexec + "Start /inv/c copy/u m:\autocad_programs\DR14\*.* c:\acad14\DRESSER\*.* /s"
endif
; -----------------------------------------------------------------
; Setting Default Screen Saver to default Logon box with Password
; Could be done in POLICY but problmes with Win9x?
; -----------------------------------------------------------------
? "Set screen saver at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Setting Default Screen Saver to default Logon box with Password...")
$RegSSLoc="HKEY_CURRENT_USER\Control Panel\Desktop"
$dummy=WriteValue($RegSSLoc,"SCRNSAVE.EXE","%windir%\system32\logon.scr","REG_SZ")
$dummy=WriteValue($RegSSLoc,"ScreenSaveTimeOut","2400","REG_SZ")
$dummy=WriteValue($RegSSLoc,"ScreenSaveActive","1","REG_SZ")
$dummy=WriteValue($RegSSLoc,"ScreenSaverIsSecure","1","REG_SZ")
; ----------------------------------------------------------------------------------
; Set up DOS printers. This routine read an input file to set up the necessary
; LPT ports for useage by som old Dos based programs
; ----------------------------------------------------------------------------------
IF OPEN(1,"c:\dosprint.btm")=0
? "Setting up printers for DOS applications at " + @TIME ?
WHILE @ERROR=0
$X = READLINE(1)
$LPTinfo = instr($X,"lpt")
$PortNo = substr($X,$LPTInfo,5)
$ServerPos=instr($X,"\\")
$PrinterString1=substr($X,$ServerPos +2,len($X))
$PrinterPos=instr($PrinterString1,"\")
$PrinterLengde=LEN($PrinterString1)-$PrinterPos
$PrinterNavn=substr($PrinterString1,$PrinterPos +1,$PrinterLengde)
$Kommando="\\" + $P_SERVER + "\" + $PrinterNavn
use $PortNo /D
use $PortNo $Kommando
LOOP
CLOSE(1)
ENDIF

ENDIF
; -----------------------------------------------
; Delete files older than 2 days from C\TEMP
; -----------------------------------------------
? "Clean-up Temp folder at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Clean-up TEMP Folder...")
run $4dosexec + "Start /inv/c del c:\temp\*.* /[d-2,-90] /s /Y /z"
;==================================================================================================

;Object cleanup
? "Logon script finished at " + @TIME ?
$nul = oleputproperty ( $frmMessage, "value", "s", "Logon finished...")
sleep 5

$nul = olecallfunc ( $doc, "close" )
$nul = olereleaseobject ( $doc )
$nul = olecallfunc ( $ie, "quit" )
$nul = olereleaseobject ( $ie )

EXIT

; --------------------------------------------------------------------
; Logon Script Subroutines
; Do not modify any lines below this!!!
;----------
:htmllogon
;----------
$html = '<html>
<head>
<title>$Welcome</title>
</head>
<body bgcolor="#0000FF">
<div align="center"><center>
<table border="5" width="400" bgcolor="#000000"bordercolor="#008000" bordercolordark="#008080"
bordercolorlight="#00FF00">
<tr><td><p align="center"><font color="#FFFFFF" size="4">
<strong>$Welcome</strong></font></p>
</td>
</tr>
</table>
</center>
</div><p> </p>
<div align="center"><center>
<table border="5" width="400" bgcolor="#000000"
bordercolor="#008000" bordercolordark="#008080"
bordercolorlight="#00FF00">
<tr>
<td><p align="left"><font color="#FFFFFF">User ID:</font></p></td>
<td><p align="left"><font color="#FFFF00"><strong>$UserName</strong></font></p></td>
</tr>
<tr>
<td><p align="left"><font color="#FFFFFF">Full Name:</font></p></td>
<td><font color="#FFFF00"><strong>$FullName</strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF">Privilege:</font></td>
<td><font color="#FFFF00"><strong>$Priv</strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF">Workstation:</font></td>
<td><font color="#FFFF00"><strong>$Wksta</strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF">Domain:</font></td>
<td><font color="#FFFF00"><strong>$Domain</strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF">Logon Server:</font></td>
<td><font color="#FFFF00"><strong>$LServer</strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF">Logon:</font></td>
<td><font color="#FFFF00"><strong>$LocalInfo</strong></font></td></tr>
<tr>
<td><font color="#FFFFFF">LogonSite:</font></td>
<td><font color="#FFFF00"><strong>$LogonSite</strong></font></td></tr>
<tr>
<td><font color="#FFFFFF">TCP/IP Addr:</font></td>
<td><font color="#FFFF00"><strong>$IPaddr</strong></font></td></tr>
</table></center></div><p> </p>
<div align="center"><center>
<table border="5" width="400" bgcolor="#000000" bordercolor="#008000" bordercolordark="#008080" bordercolorlight="#00FF00">
<tr><td><strong><input type=tbox id=frmMessage size=80></strong></td>
</tr>
<tr>
<td><font color="#FFFF00">$StatusMessage</font></td>
</tr></table></center></div></body>
</html>
'
return

Top
#51457 - 2000-12-07 02:44 PM Re: New Logon Script Using OLE!
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Oyvinn:

You're correct... some comments...

1) KiX OLE under Win9x is broken. If you do some further testing - you'll probably find that this statement...

$doc = val("&" + olegetproperty($ie, "document"))

Is returning a "0" on Win9x - It's definitely a KiX problem and not an OLE / IE / WIN problem. Bryce and I tested this same code using VBScript on Win9x and it works fine !

2) Stick with at least NTsp3 and IEsp2 or later for any of this OLE stuff.

3) The delay in starting IE shouldn't be any longer than what it would take to noramally start your browser on your workstation - it might even be a "shade" faster because it doesn't have to navigate to a "real" start page...

4) I admire your willingness and success in implementing innovative script ideas !

Shawn.


Top
#51458 - 2000-12-07 03:56 PM Re: New Logon Script Using OLE!
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I was very disappointed about the OLE control of IE on win9x computers.

I have a whole line of canned utils/user interface ready to go, but dropped them when we found this bug.

Also, I think that the OLE commands will be changing in a major way for Kix2000. The chance exists, that your OLE code for Kix 3.63 may not work for Kix2000. (Please note: I am only basing this on observations of the alpha release of Kix2000, and only the creator him self "Rudd", will be able to give the final word on this)

Bryce

Top
#51459 - 2000-12-07 04:07 PM Re: New Logon Script Using OLE!
Anonymous
Unregistered


1) I think this is a really cool use for the OLE stuff. (Lots of ideas come to mind)

2) Shawn's message about 9x clients not being able to use this is very upsetting. (all the ideas that came to mind in #1 are being squashed by #2)

3) Using OLE, is there a way to get information from IE back to the script? With a form or a button? I found that adding a form with ictar's progress routine works.

:CloseWindow
$StatusMessage = '<CENTER><FORM>
<INPUT TYPE="BUTTON" VALUE="Close Window" onClick="top.close()">
</FORM></CENTER>'
Gosub Progress

Puts a close window button in the window.

Only problem with this is that when you click close, another message pops up telling you that the window is closing and asks if it's OK.

Mark P.

Top
#51460 - 2000-12-07 04:27 PM Re: New Logon Script Using OLE!
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Mark,

Yes the OLE/IE bug in win9x was a major show stopper. But i did get 1 of my IE/OLE interface programs written.

go to me web page, and click on password_prompt. take a look at the GUI_PASSWORD.kix.


Also do a search for OLE (use the user name "shawn" as a filter ) on this board. The threads that you will want to revisit are in the months of August, Sept, and Oct.

Bryce

Top
#51461 - 2000-12-07 04:47 PM Re: New Logon Script Using OLE!
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm very confused in terms of where Ruud is heading with OLE. He's redesigning the syntax and it's looking good !

But (always the "but") - will he provide backward support for the old olefunc() commands ? Given the history of KiX - I imagine he will ? As well - any of the testing I've done with these new functions in the alpha release of Kix2K have failed miserably.

The OLE syntax in Kix2K will be much more intuitive and easy to learn - it will also blend in much better with the rest of the Kix language (right now - I think the OLE functions stand out like a sore thumb).

Using that OLE 101 example, this is how I see Kix2K OLE shaping up ...

code:


$KixCalc = CreateObject ( "Kixtart.Calculator")


$KixCalc.Number = 5


$KixCalc.MultiplyNumberBy ( "5" )


?"Result = " $KixCalc.Number


ReleaseObject ( $KixCalc )



I'm getting excited about Kix2K - I wonder how Rudd is making out with it - would be nice to see a newer Alpha version ?

Shawn.

[This message has been edited by Shawn (edited 07 December 2000).]

Top
#51462 - 2000-12-07 06:05 PM Re: New Logon Script Using OLE!
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
Bryce actually addressed the passing of a value back to kix with his dropdown script. In the HTML code put <input type=hidden id=variablename value="1"> Then reference the hidden control using the onclick method, or if using a dropdown list, just reference the value.

Then when referencing the value from kix use $myvalue = olegetproperty(val("&" + olecallfunc($doc, "GetElementById","s","variablename")), "value")

Unfortunately I'm still working on getting a checkbox control to toggle properly. I guess I will have to add some VBS into the web page to do this. Shawn, Bryce, Any other ideas on this?

------------------
"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...

Top
#51463 - 2000-12-07 07:46 PM Re: New Logon Script Using OLE!
Anonymous
Unregistered


Thanks Bryce, your GUI_Password script is great.

I was goofing arround and came up with this little addon to the OLE login script. Modified the Progress sub a little. It just adds a little progress bar. Tried everything to get the progress bar to be wider, but it just want's to be that size. Oh well.


code:
;----------
:Progress
;----------

IF $Percent = "100"
$StatusMessage = '$StatusMessage<TABLE border=1 width=100% CELLSPACING=0 CELLPADDING=0><TR height=20 WIDTH=100%><TD ALIGN=center WIDTH=$percent% BGCOLOR=Blue><font color="#FFFFFF">DONE</FONT></td></TR></TABLE>'
ELSE
$StatusMessage = '$StatusMessage<TABLE border=1 width=100% CELLSPACING=0 CELLPADDING=0><TR height=20 WIDTH=100%><TD WIDTH=$percent% BGCOLOR=Blue> </td><TD BGCOLOR=silver> </TD></TR></TABLE>'
ENDIF
$Status = "Message Center ($percent% complete)"
$nul = oleputproperty ( $frmMessage, "innerhtml", "s", '<font color="#FFFFFF"><strong>$Status</strong></font>' )
$nul = oleputproperty ( $frmStatus, "innerhtml", "s", '<font color="#FFFF00">$StatusMessage</font>' )
sleep 1
return

Mark P.

Top
#51464 - 2000-12-07 10:18 PM Re: New Logon Script Using OLE!
Anonymous
Unregistered


Made another modification using using example from Bryce's GUI_Password script.

When the script is done, it replaces the progress bar with a DONE button, which closes the window and allows the script to end.

If you want to, you can put a SetConsole("hide") at the begining of the script.

Replace:

code:
? "Pause..."
get $x

With:

code:
GOSUB "WaitForDone"

And replace the progress sub with the following:

code:

;----------
:Progress
;----------

IF $Percent = "100"
$StatusMessage = '$StatusMessage<FORM name=frm><input id=done type=button value=" DONE! " onclick="frm.status.value=1"><input type=hidden id=status name=status value=0></FORM>'
ELSE
$StatusMessage = '$StatusMessage<TABLE border=1 width=100% CELLSPACING=0 CELLPADDING=0><TR height=20 WIDTH=100%><TD WIDTH=$percent% BGCOLOR=Blue> </td><TD BGCOLOR=silver> </TD></TR></TABLE>'
ENDIF
$Status = "Message Center ($percent% complete)"
$nul = oleputproperty ( $frmMessage, "innerhtml", "s", '<font color="#FFFFFF"><strong>$Status</strong></font>' )
$nul = oleputproperty ( $frmStatus, "innerhtml", "s", '<font color="#FFFF00">$StatusMessage</font>' )
sleep 1
return

;---------
:WaitForDone
;---------
while setfocus("$welcome") <> 0 loop
$Status = olegetproperty (val("&" + olecallfunc($doc,"GetElementById","s","status")), "value" )

; Main Command Loop
while @error = 0 and $Status = "0"
$Status = olegetproperty (val("&" + olecallfunc($doc,"GetElementById","s","status")), "value" )
;? $Status
loop
return


Mark P.

Top
#51465 - 2000-12-08 05:44 AM Re: New Logon Script Using OLE!
oyvinn Offline
Fresh Scripter

Registered: 2000-12-05
Posts: 10
Loc: Kongsberg
Mark and Bryce

Thank you very much for your effort and quick response to my posting!

But it is sad that there is a OLE bug in KixTart. The idea with using OLE was great! I had so many ideas (from years back) that i now wanted to implement.

Regards
Oyvinn

Top
#51466 - 2000-12-08 01:24 PM Re: New Logon Script Using OLE!
Anonymous
Unregistered


quote:

Tried everything to get the progress bar to be wider, but it just want's to be that size. Oh well.

Guess I didn't try everything... Found that if you just change the table size in the following line to something like 300% it will make the progress bar wider.

I didn't think you could make a table more than 100% wide.

code:
$StatusMessage = '$StatusMessage<TABLE border=1 width=300% CELLSPACING=0 CELLPADDING=0><TR height=20 WIDTH=100%><TD NOWRAP WIDTH=$percent% BGCOLOR=Blue> </td><TD NOWRAP BGCOLOR=silver> </TD></TR></TABLE>'

Mark P.

Top
#51467 - 2000-12-08 03:26 PM Re: New Logon Script Using OLE!
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Be sure to make those % to be %% (this is a special reserved character in kix). I got some weird results when i tried using just a single %.

Bryce


Top
#51468 - 2000-12-10 11:45 AM Re: New Logon Script Using OLE!
Anonymous
Unregistered


Dear all,

Thanks Icatar, Shawn and others which make Kixtart so amazing. But I have the following question.

when I use icatar's script, I just find the following question:

1.the IE5.5 welcome message is shown on the screen, how can I get rid of it.

2. when the IE windows and the message was shown, the user will close it using the "X" at the top right hand corner, or the menu from top left hand corent, how can I hide the bar or just dim the "X"

3. the duration is my great concren, we are using NT4,SP6, IE5.5,PIII733, 64Mbyte Ram, I found that the it need almost 20 second or more from logon to launch the IE and show the message, while the "old" dos box just need less then 5 second to complete the script.

Thanks for the attention.

Still a newbie in Kixtart
Gilbert Ng

Top
#51469 - 2000-12-11 01:38 PM Re: New Logon Script Using OLE!
Anonymous
Unregistered


Hey You !!

Sorry for my stupid english but my motherlanguage is german.

The Script is absolutely Cool !! But i have a question:

If the IE-Window appears, the user can close this Window by clicking the "x" in the upper right window corner or by clicking on the IE Icon in the top left and select close.

Is it possible to deactivate this functions ??? Because it isn´t good if the user can stop the Logon Process.

Thanx !!

Go on scripting

and nice greetings from Austria (NOT Australia)

TheUnknown

Top
#51470 - 2001-10-12 08:35 AM Re: New Logon Script Using OLE!
oyvinn Offline
Fresh Scripter

Registered: 2000-12-05
Posts: 10
Loc: Kongsberg
Is there any solution to the problem with
$doc = val("&" + olegetproperty($ie, "document"))returning a "0" on Win9x ?

I tried the same under KIX2001 release candidate 3 with the same result.


Oyvinn

Top
#51471 - 2001-10-12 03:36 PM Re: New Logon Script Using OLE!
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
oyvinn

go here

-Shawn

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.063 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org