1) to get the script path and the script name, i use the following code
set scriptdir=%~dp0
set scriptname=%~n0

%0 is the name of the current script
~ remove " at beginning and end of the name
d extracts drive
p extracts path
n extracts the name of the script without extension
if needed, x extraxt the extension

so %~dpnx0 gives the full script name.

2) have you tried to copy kix32.exe locally ? this may reduce time to launch adlogon.kix because it prevents from copying 300 KB on a WAN link (except the first time for each user of a workstation) and the AV scans locally !!!

3) i think the first parameter $adlcdir is not useful because it is the name of the kixtart script directory. in the kix script, you can use $adlcdir = @scriptdir.

to debug, this gives a script like that for adlogon.cmd :
 Code:
@echo off
setlocal
  set scriptdir=%~dp0
  set scriptname=%~n0
  
  set AdLogFilename=%temp%\%scriptname%_%username%
  set AdLogExt=.log
  set KIXLOG=%ADLOGFN%_kix%ADLOGEXT%

  if not exist "%temp%\kix32.exe" (
    rem -- copy kix32 locally if not exist --
    copy "%scriptdir%kix32.exe" "%temp%\"
  ) else (
    rem -- update kix32 locally if needed --
    replace "%scriptdir%kix32.exe" "%temp%\" /u
  )
...
  set command="%temp%\kix32.exe" "%scriptdir%%scriptname%.kix" $logfile="%kixlog%"
  echo command : %command%
  echo before kix : %date% %time%
  %command%
endlocal

for the beginning of kix script :
 Code:
"beginning kix : " @Date " " @Time ?

break off
$adlcdir = @scriptdir
...
When the code is debugged, you can remove comment and echo lines.
_________________________
Christophe