This code goes into the Scripts editor, tab "Remote".

Code:
raw 364:*: .fwrite -n links $2- | halt
raw 365:*: .fclose links | halt
[color:red]  [/color] 
alias links {
  var %e = echo -ac info * /links: 
  if (!$server) { %e not connected to server | return }
  if ($fopen(links)) .fclose links
  .fopen -o links links.txt 
  if ($ferr) { %e error opening links.txt | return }
  !links
} 

This will write the links information to links.txt in your main mIRC folder. It will no longer open the Links window. If you still want to see the window, remove the halt from the second raw.