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