There's a couple of problems with your code.
1.Tthe reason is $1- (note the dash at the end) and not $1.
2. In your write command, you don't specify any text to be written to the file.
That being said, here is an optimized version of your code:
on *:KICK:#:{
[color:blue]; If the @window is not open, open it
; With this line included, you can remove the window command for on CONNECT[/color]
if (!$window(@kicked)) window @kicked
aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick from $chan for $1-
[color:blue]; Writes the last (newest) line in your @window to the text file[/color]
write $logdirkicked.txt $line(@kicked,$line(@kicked,0))
}
BTW, $logdirkicked.txt is not a typo. There is no \ required when using directory identifiers. If you try
//echo -a $logdirkicked.txt you will see that it returns C:\path\to\mIRC\logs\kicked.txt