#75315 - 2003-06-08 07:40 AM
Script execution time
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
Our users used to execute the login script from specific folder on the main domain when they login in. This login script executed through a bat file as follow: %0\..\KIX32 %0\..\Login_Script.KIX
I have edited the bat file to copy the Kix32 and the script to the user workstation and execute the script from their as follow: COPY %0\..\KIX32.EXE %WINDIR%\KIX32.EXE > NUL COPY %0\..\ Login_Script.KIX %WINDIR%\ Login_Script.KIX > NUL %WINDIR%\KIX32.exe %WINDIR%\ Login_Script.KIX
Will this speedup the script execution time?
Thank you.
|
Top
|
|
|
|
#75317 - 2003-06-08 01:13 PM
Re: Script execution time
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'd xcopy /d /v the kix32.exe to the client, but the script should remain on the server...
|
Top
|
|
|
|
#75318 - 2003-06-08 05:37 PM
Re: Script execution time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
BTW,
You can check execution time with - DeltaTime()
HTH,
Kent
|
Top
|
|
|
|
#75320 - 2003-06-08 08:10 PM
Re: Script execution time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Never mind.. I went back and re-read the main purpose of the script. The subject is worded 'Script execution time' where it needs to be 'How long to copy script files to the client?'.
Kent [ 08. June 2003, 20:16: Message edited by: kdyer ]
|
Top
|
|
|
|
#75322 - 2003-06-15 01:01 PM
Re: Script execution time
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
Coping Kix32 and the login script every time was one of the batch concerns. (as Ntdoc mentioned) I think the following modification in the batch will solve this problem.
IF Not Exist %WINDIR%\KIX32.EXE COPY %0\..\KIX32.EXE %WINDIR%\KIX32.EXE IF Not Exist %WINDIR%\Login_Script.KIX COPY %0\..\ Login_Script.KIX %WINDIR%\ Login_Script.KIX %WINDIR%\KIX32.exe %WINDIR%\Login_Script.KIX
Thank you.
|
Top
|
|
|
|
#75323 - 2003-06-15 01:57 PM
Re: Script execution time
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You should review the two logon script batch file examples in the following thread: LOGON.BAT (the overkill version)
The second one only copies the files to the client when the files on the client either do not exist or the CRC32 check fails. You can also use "XCOPY /D" to update as necessary. [ 15. June 2003, 13:58: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#75325 - 2003-06-19 01:48 PM
Re: Script execution time
|
Gaven
Starting to like KiXtart
Registered: 2003-06-19
Posts: 103
Loc: Washinton DC, USA
|
I have a suggestion. Why don't you have the logon batch file copy kix32.exe to the %windir% if it doesn't exist, and run the Kix script from the netlogon folder. A small bit of code can then update the kix32.exe file as necessary. The benifit to this is based off the fact that the kix script is copied to memory on loading and the actual file is unused beyond that point. However it can be a burden on your server to be running the same kix32.exe file for dozens of workstations so running a local kix32.exe makes more sense and it ultimately minimizes bandwith use. The logon batch file should contain basic copy commands like: If Not Exist %windir%\kix32.exe Copy %0\..\kix32.exe %windir% start %windir%\kix32.exe %0\..\kixstart.kix
Then, to maintain the local kix32.exe file (and wkix32.exe as you'll see in the code), I have the following code run in the logon kix script: ; Define variables $kixupdate = "%windir%\kixupd.bat" ; batch file to create to update KixStart executables
; Run this code at the begining of your logon script, all code before this will be run a SECOND time if kix32.exe gets updated If Exist($kixupdate) Del "$kixupdate" goto "kixupddone" EndIf
; Run this code at the end of the logon script $fv1=GetFileVersion("%windir%\Kix32.exe","ProductVersion") $fv2=GetFileVersion("%windir%\Wkix32.exe","ProductVersion") $fv3=GetFileVersion("@LSERVER\NETLOGON\Kix32.exe","ProductVersion") $fv4=GetFileVersion("@LSERVER\NETLOGON\Wkix32.exe","ProductVersion") If $fv1<>$fv3 Or $fv2<>$fv4 $rc=Open(1,$kixupdate,5) If $rc<>0 goto "kixupddone" EndIf $rc=WriteLine(1,"@@Echo Off"+@crlf+"ping 127.0.0.1 > nul"+@crlf+"Del %windir%\kix32.exe"+@crlf+"Del %windir%\wkix32.exe"+@crlf+"Copy @LSERVER\NETLOGON\kix32.exe %windir%"+@crlf+"Copy @LSERVER\NETLOGON\wkix32.exe %windir%"+@crlf+"start %windir%\wkix32.exe %windir%\kixstart.kix"+@crlf+"Exit") $rc=Close(1) Sleep 1 Run("$kixupdate") Exit EndIf :kixupddone
|
Top
|
|
|
|
#75329 - 2003-06-20 08:57 PM
Re: Script execution time
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
This is my very small 'overkill version' of logon.bat
Always execute the KIX executeables from the client.
Needed KiX files are only copied if the are newer in the netlogon share.
This also handles the issues for %0\..\ on XP systems. Instead of using %0\..\ on NT+ systems, this is used: %LogonServer%\NetLogon This works on NT+ because the env. variable %LogonServer% is known to all af these OS's
code:
@Echo Off
Echo Network logon ... Echo. IF NOT EXIST C:\KiXdir\NUL MD C:\KiXdir IF NOT %OS%.==. GoTo KixNT XCopy %0\..\*Kix32.exe C:\KiXdir\*.* /D /R /Y >Nul XCopy %0\..\KX*.dll C:\KiXdir\*.* /D /R /Y >Nul C:\KiXdir\Kix32.exe %0\..\Logon\Logon.kix Exit :KixNT Echo a | XCopy %LogonServer%\NetLogon\Kix32\*KiX32.exe C:\KiXdir\*.* /D /R >Nul C:\KiXdir\Kix32.exe "%LogonServer%\NetLogon\Logon\Logon.kix"
I agree with NTDOC, don't copy the scripts to the client if you don't have a way of controlling the scriptversion other than xcopy /d
A totally different story: I DO copy the script to the client, but the first called script, ie. logon.kix is NEVER copied to the client. Logon.kix then checks the date/time of all other scripts called by logon.kix and copyes them to the client if the timestamp is different.
This would not speed up the logon time alone, because getting the timestamp of the files in the netlogon share would be about the same time as executing the file from the netlogon share.
BUT: I have a script that generates an ini-file with the timestamp for every file in the netlogon share, this file alone is checked for time difference by logon.kix and if different it is copyed to the client. The rest of the file compare is then done on the client without causing trafic on the net.
Sample of the ini-file
code:
[FileTime] WinSet.exe=1995/08/24 10:50:00 NewPath.kix=2002/08/30 09:22:03 ProgInfo.kix=2002/04/01 17:53:24 PrtDef.ini=2003/06/10 15:10:09 UserMsg.kix=2002/06/26 19:20:06 UserPrf.kix=2002/11/10 19:20:23 W95PSet.kix=2002/07/23 13:39:18
The backside of this is that you have to execute the script that generates the ini-file each time you change anything in the netlogon share.
The advantage is that you can use the same logonscript for all users, and don't bother if they are WAN or LAN users. AND You don't have to create a userprofile to use at work and a differet userprofile to use at home if you have users connectet to the domain from their home ws.
In a short time this won't matter to anyone (the ones that have converted to active directory and 2k+ on all clients )
-Erik
|
Top
|
|
|
|
#75330 - 2003-06-20 11:16 PM
Re: Script execution time
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Erik,
Your batch file has the same similar issue. If for some reason the KIX32.EXE file is not copied to the client, you'll never process any logon script and you'll never know about it either. You make no check to verify the file is there before you try to call it.
Yes, I agree that we all can/do have our own methods of doing things. That is why I also mentioned actually doing some testing of the speed difference between the KiX files being on the NETLOGON and being locally. If you're testing only shows a mere second or so, why bother copying to the local system. Waste of time in my opinion ( My time )
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|